Skip to content

Commit 81bd756

Browse files
jason-simmonsGaryQian
authored andcommitted
Handle null bundlePaths in FlutterRunArguments (flutter#7161)
1 parent 0c1b1f7 commit 81bd756

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

shell/platform/android/io/flutter/view/FlutterNativeView.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,16 @@ public void assertAttached() {
7676
}
7777

7878
public void runFromBundle(FlutterRunArguments args) {
79-
if (args.bundlePath == null && args.bundlePaths.length == 0) {
79+
boolean hasBundlePaths = args.bundlePaths != null && args.bundlePaths.length != 0;
80+
if (args.bundlePath == null && !hasBundlePaths) {
8081
throw new AssertionError("Either bundlePath or bundlePaths must be specified");
8182
} else if ((args.bundlePath != null || args.defaultPath != null) &&
82-
args.bundlePaths.length != 0) {
83+
hasBundlePaths) {
8384
throw new AssertionError("Can't specify both bundlePath and bundlePaths");
8485
} else if (args.entrypoint == null) {
8586
throw new AssertionError("An entrypoint must be specified");
8687
}
87-
if (args.bundlePaths.length != 0) {
88+
if (hasBundlePaths) {
8889
runFromBundleInternal(args.bundlePaths, args.entrypoint, args.libraryPath);
8990
} else {
9091
runFromBundleInternal(new String[] {args.bundlePath, args.defaultPath},

0 commit comments

Comments
 (0)