Browse Source

Check for NPE when removing long press listener on buttons

Guy Carmeli 7 years ago
parent
commit
d089ec845b

+ 1
- 1
android/app/src/main/java/com/reactnativenavigation/views/TitleBarButton.java View File

@@ -70,7 +70,7 @@ class TitleBarButton implements MenuItem.OnMenuItemClickListener {
70 70
             @Override
71 71
             public void run() {
72 72
                 ActionMenuView actionMenuView = ViewUtils.findChildByClass(parent, ActionMenuView.class);
73
-                if (actionMenuView != null) {
73
+                if (actionMenuView != null && actionMenuView.getChildAt(index) != null) {
74 74
                     actionMenuView.getChildAt(index).setOnLongClickListener(null);
75 75
                 }
76 76
             }