Amit Kumar 5 år sedan
förälder
incheckning
35851fc989

+ 2
- 2
lib/android/app/src/main/java/com/reactnativenavigation/presentation/ComponentPresenterBase.java Visa fil

@@ -7,7 +7,7 @@ import android.view.ViewGroup.MarginLayoutParams;
7 7
 public class ComponentPresenterBase {
8 8
     public void applyTopInsets(@NonNull View view, int topInsets) {
9 9
         MarginLayoutParams lp = (MarginLayoutParams) view.getLayoutParams();
10
-        if (lp.topMargin != topInsets) {
10
+        if (lp != null && lp.topMargin != topInsets) {
11 11
             lp.topMargin = topInsets;
12 12
             view.requestLayout();
13 13
         }
@@ -15,7 +15,7 @@ public class ComponentPresenterBase {
15 15
 
16 16
     public void applyBottomInset(@NonNull View view, int bottomInset) {
17 17
         MarginLayoutParams lp = (MarginLayoutParams) view.getLayoutParams();
18
-        if (lp.bottomMargin!= bottomInset) {
18
+        if (lp != null && lp.bottomMargin!= bottomInset) {
19 19
             lp.bottomMargin = bottomInset;
20 20
             view.requestLayout();
21 21
         }