Bladeren bron

Check for NPE when removing long press listener on buttons

Guy Carmeli 7 jaren geleden
bovenliggende
commit
d089ec845b
1 gewijzigde bestanden met toevoegingen van 1 en 1 verwijderingen
  1. 1
    1
      android/app/src/main/java/com/reactnativenavigation/views/TitleBarButton.java

+ 1
- 1
android/app/src/main/java/com/reactnativenavigation/views/TitleBarButton.java Bestand weergeven

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