Преглед на файлове

createAdditionalReactPackages now nullable

Daniel Zlotin преди 8 години
родител
ревизия
4db262d461
променени са 1 файла, в които са добавени 5 реда и са изтрити 2 реда
  1. 5
    2
      android/app/src/main/java/com/reactnativenavigation/NavigationApplication.java

+ 5
- 2
android/app/src/main/java/com/reactnativenavigation/NavigationApplication.java Целия файл

@@ -2,7 +2,7 @@ package com.reactnativenavigation;
2 2
 
3 3
 import android.app.Application;
4 4
 import android.os.Handler;
5
-import android.support.annotation.NonNull;
5
+import android.support.annotation.Nullable;
6 6
 
7 7
 import com.facebook.react.ReactPackage;
8 8
 import com.facebook.react.bridge.ReactContext;
@@ -50,6 +50,9 @@ public abstract class NavigationApplication extends Application {
50 50
 
51 51
     private void addAdditionalReactPackagesIfNeeded(List<ReactPackage> list) {
52 52
         List<ReactPackage> additionalReactPackages = createAdditionalReactPackages();
53
+        if (additionalReactPackages == null) {
54
+            return;
55
+        }
53 56
 
54 57
         for (ReactPackage reactPackage : additionalReactPackages) {
55 58
             if (reactPackage instanceof MainReactPackage)
@@ -79,7 +82,7 @@ public abstract class NavigationApplication extends Application {
79 82
 
80 83
     public abstract boolean isDebug();
81 84
 
82
-    @NonNull
85
+    @Nullable
83 86
     public abstract List<ReactPackage> createAdditionalReactPackages();
84 87
 
85 88
     public void sendNavigatorEvent(String eventId, String navigatorEventId) {