Handle null bundlePaths in FlutterRunArguments (flutter/engine#7161)

This commit is contained in:
Jason Simmons 2018-12-10 14:38:44 -08:00 committed by GitHub
parent 398355981c
commit 4edb0f1f99

View File

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