Browse Source

Add null check to ViewVisibilityChecker

relates to #1555
Guy Carmeli 7 years ago
parent
commit
60608b08ae

+ 5
- 1
android/app/src/main/java/com/reactnativenavigation/utils/ViewVisibilityChecker.java View File

@@ -1,12 +1,16 @@
1 1
 package com.reactnativenavigation.utils;
2 2
 
3
+import android.support.annotation.Nullable;
3 4
 import android.view.View;
4 5
 
5 6
 import com.reactnativenavigation.views.ContentView;
6 7
 
7 8
 public class ViewVisibilityChecker {
8 9
 
9
-    public static boolean check(View view) {
10
+    public static boolean check(@Nullable View view) {
11
+        if (view == null) {
12
+            return false;
13
+        }
10 14
         final int top = getTopRelativeToContentView(view);
11 15
         final int scrollYInScreen = getScrollYInScreen(view);
12 16
         return top + view.getHeight() > scrollYInScreen;