浏览代码

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) {