Amit Kumar 5 년 전
부모
커밋
35851fc989
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2
    2
      lib/android/app/src/main/java/com/reactnativenavigation/presentation/ComponentPresenterBase.java

+ 2
- 2
lib/android/app/src/main/java/com/reactnativenavigation/presentation/ComponentPresenterBase.java 파일 보기

@@ -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
         }