Make _initRootBundle more robust
Rather than catching every exception, we now handle the one specific case where we legitimately cannot create the root bundle. Fixes #900
This commit is contained in:
parent
3cb4984909
commit
eea4bae674
@ -96,14 +96,11 @@ class MojoAssetBundle extends CachingAssetBundle {
|
||||
}
|
||||
|
||||
AssetBundle _initRootBundle() {
|
||||
try {
|
||||
AssetBundleProxy bundle = new AssetBundleProxy.fromHandle(
|
||||
new core.MojoHandle(ui.takeRootBundleHandle())
|
||||
);
|
||||
return new MojoAssetBundle(bundle);
|
||||
} catch (e) {
|
||||
int h = ui.takeRootBundleHandle();
|
||||
if (h == core.MojoHandle.INVALID)
|
||||
return null;
|
||||
}
|
||||
core.MojoHandle handle = new core.MojoHandle(h);
|
||||
return new MojoAssetBundle(new AssetBundleProxy.fromHandle(handle));
|
||||
}
|
||||
|
||||
final AssetBundle rootBundle = _initRootBundle();
|
||||
|
@ -46,9 +46,5 @@ void _debugPrintTask() {
|
||||
}
|
||||
|
||||
void debugPrintStack() {
|
||||
try {
|
||||
throw new Exception();
|
||||
} catch (e, stack) {
|
||||
debugPrint(stack.toString());
|
||||
}
|
||||
debugPrint(StackTrace.current.toString());
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user