Pārlūkot izejas kodu

Throw exception when calling startTabBasedApp with zero tabs

Guy Carmeli 7 gadus atpakaļ
vecāks
revīzija
f366b3811e

+ 3
- 0
android/app/src/main/java/com/reactnativenavigation/params/parsers/ActivityParamsParser.java Parādīt failu

@@ -21,6 +21,9 @@ public class ActivityParamsParser extends Parser {
21 21
         if (hasKey(params, "tabs")) {
22 22
             result.type = ActivityParams.Type.TabBased;
23 23
             result.tabParams = new ScreenParamsParser().parseTabs(params.getBundle("tabs"));
24
+            if (result.tabParams.size() == 0) {
25
+                throw new RuntimeException("Tried to start tab based app with zero tabs");
26
+            }
24 27
         }
25 28
 
26 29
         if (hasKey(params, "sideMenu")) {