Repository: openfoodfacts/openfoodfacts-androidapp
Issue: java.lang.IllegalStateException  android.widget.RelativeLayout$DependencyGraph.getSortedViews

Yesterday, 11:16 PM on app version 40
OnePlus One (A0001), 3072MB RAM, Android 6.0
Report 1 of 1
java.lang.IllegalStateException: 
  at android.widget.RelativeLayout$DependencyGraph.getSortedViews (RelativeLayout.java:1724)
  at android.widget.RelativeLayout.sortChildren (RelativeLayout.java:382)
  at android.widget.RelativeLayout.onMeasure (RelativeLayout.java:389)
  at android.view.View.measure (View.java:18799)
  at android.widget.ListView.setupChild (ListView.java:1958)
  at android.widget.ListView.makeAndAddView (ListView.java:1879)
  at android.widget.ListView.fillDown (ListView.java:702)
  at android.widget.ListView.fillFromTop (ListView.java:763)
  at android.widget.ListView.layoutChildren (ListView.java:1685)
  at android.widget.AbsListView.onLayout (AbsListView.java:2148)
  at android.view.View.layout (View.java:16639)
  at android.view.ViewGroup.layout (ViewGroup.java:5437)
  at android.widget.LinearLayout.setChildFrame (LinearLayout.java:1735)
  at android.widget.LinearLayout.layoutVertical (LinearLayout.java:1579)
  at android.widget.LinearLayout.onLayout (LinearLayout.java:1488)
  at android.view.View.layout (View.java:16639)
  at android.view.ViewGroup.layout (ViewGroup.java:5437)
  at android.support.constraint.ConstraintLayout.onLayout (ConstraintLayout.java:1197)
  at android.view.View.layout (View.java:16639)
  at android.view.ViewGroup.layout (ViewGroup.java:5437)
  at android.widget.FrameLayout.layoutChildren (FrameLayout.java:336)
  at android.widget.FrameLayout.onLayout (FrameLayout.java:273)
  at android.view.View.layout (View.java:16639)
  at android.view.ViewGroup.layout (ViewGroup.java:5437)
  at android.widget.LinearLayout.setChildFrame (LinearLayout.java:1735)
  at android.widget.LinearLayout.layoutVertical (LinearLayout.java:1579)
  at android.widget.LinearLayout.onLayout (LinearLayout.java:1488)
  at android.view.View.layout (View.java:16639)
  at android.view.ViewGroup.layout (ViewGroup.java:5437)
  at android.support.v4.widget.DrawerLayout.onLayout (DrawerLayout.java:1172)
  at android.view.View.layout (View.java:16639)
  at android.view.ViewGroup.layout (ViewGroup.java:5437)
  at android.widget.FrameLayout.layoutChildren (FrameLayout.java:336)
  at android.widget.FrameLayout.onLayout (FrameLayout.java:273)
  at android.view.View.layout (View.java:16639)
  at android.view.ViewGroup.layout (ViewGroup.java:5437)
  at android.widget.LinearLayout.setChildFrame (LinearLayout.java:1735)
  at android.widget.LinearLayout.layoutVertical (LinearLayout.java:1579)
  at android.widget.LinearLayout.onLayout (LinearLayout.java:1488)
  at android.view.View.layout (View.java:16639)
  at android.view.ViewGroup.layout (ViewGroup.java:5437)
  at android.widget.FrameLayout.layoutChildren (FrameLayout.java:336)
  at android.widget.FrameLayout.onLayout (FrameLayout.java:273)
  at android.view.View.layout (View.java:16639)
  at android.view.ViewGroup.layout (ViewGroup.java:5437)
  at android.widget.LinearLayout.setChildFrame (LinearLayout.java:1735)
  at android.widget.LinearLayout.layoutVertical (LinearLayout.java:1579)
  at android.widget.LinearLayout.onLayout (LinearLayout.java:1488)
  at android.view.View.layout (View.java:16639)
  at android.view.ViewGroup.layout (ViewGroup.java:5437)
  at android.widget.FrameLayout.layoutChildren (FrameLayout.java:336)
  at android.widget.FrameLayout.onLayout (FrameLayout.java:273)
  at com.android.internal.policy.PhoneWindow$DecorView.onLayout (PhoneWindow.java:2934)
  at android.view.View.layout (View.java:16639)
  at android.view.ViewGroup.layout (ViewGroup.java:5437)
  at android.view.ViewRootImpl.performLayout (ViewRootImpl.java:2179)
  at android.view.ViewRootImpl.performTraversals (ViewRootImpl.java:1939)
  at android.view.ViewRootImpl.doTraversal (ViewRootImpl.java:1115)
  at android.view.ViewRootImpl$TraversalRunnable.run (ViewRootImpl.java:6023)
  at android.view.Choreographer$CallbackRecord.run (Choreographer.java:858)
  at android.view.Choreographer.doCallbacks (Choreographer.java:670)
  at android.view.Choreographer.doFrame (Choreographer.java:606)
  at android.view.Choreographer$FrameDisplayEventReceiver.run (Choreographer.java:844)
  at android.os.Handler.handleCallback (Handler.java:739)
  at android.os.Handler.dispatchMessage (Handler.java:95)
  at android.os.Looper.loop (Looper.java:148)
  at android.app.ActivityThread.main (ActivityThread.java:5461)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:726)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:616)

Changed files:
app/src/main/java/openfoodfacts/github/scrachx/openfood/views/product/ingredients/IngredientsProductFragment.java

diff --git a/app/src/main/java/openfoodfacts/github/scrachx/openfood/views/product/ingredients/IngredientsProductFragment.java b/app/src/main/java/openfoodfacts/github/scrachx/openfood/views/product/ingredients/IngredientsProductFragment.java
index 7c44ae1bc..b971a4847 100644
--- a/app/src/main/java/openfoodfacts/github/scrachx/openfood/views/product/ingredients/IngredientsProductFragment.java
+++ b/app/src/main/java/openfoodfacts/github/scrachx/openfood/views/product/ingredients/IngredientsProductFragment.java
@@ -155,10 +155,8 @@ public class IngredientsProductFragment extends BaseFragment implements IIngredi
         super.refreshView(state);
         mState = state;
 
-        try {
+        if(getArguments()!=null){
             mSendProduct = (SendProduct) getArguments().getSerializable("sendProduct");
-        } catch (NullPointerException e) {
-            e.printStackTrace();
         }
 
         mAdditiveDao = Utils.getAppDaoSession(getActivity()).getAdditiveDao();