From 4edb0f1f99a98dbe12e0741b73e450c32b3954de Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Mon, 10 Dec 2018 14:38:44 -0800 Subject: [PATCH] Handle null bundlePaths in FlutterRunArguments (flutter/engine#7161) --- .../android/io/flutter/view/FlutterNativeView.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/engine/src/flutter/shell/platform/android/io/flutter/view/FlutterNativeView.java b/engine/src/flutter/shell/platform/android/io/flutter/view/FlutterNativeView.java index bf49b43c2a..6d4a4e8bdc 100644 --- a/engine/src/flutter/shell/platform/android/io/flutter/view/FlutterNativeView.java +++ b/engine/src/flutter/shell/platform/android/io/flutter/view/FlutterNativeView.java @@ -76,15 +76,16 @@ public class FlutterNativeView implements BinaryMessenger { } public void runFromBundle(FlutterRunArguments args) { - if (args.bundlePath == null && args.bundlePaths.length == 0) { + boolean hasBundlePaths = args.bundlePaths != null && args.bundlePaths.length != 0; + if (args.bundlePath == null && !hasBundlePaths) { throw new AssertionError("Either bundlePath or bundlePaths must be specified"); } else if ((args.bundlePath != null || args.defaultPath != null) && - args.bundlePaths.length != 0) { + hasBundlePaths) { throw new AssertionError("Can't specify both bundlePath and bundlePaths"); } else if (args.entrypoint == null) { throw new AssertionError("An entrypoint must be specified"); } - if (args.bundlePaths.length != 0) { + if (hasBundlePaths) { runFromBundleInternal(args.bundlePaths, args.entrypoint, args.libraryPath); } else { runFromBundleInternal(new String[] {args.bundlePath, args.defaultPath},