Index: runtime/observatory/lib/src/app/page.dart |
diff --git a/runtime/observatory/lib/src/app/page.dart b/runtime/observatory/lib/src/app/page.dart |
index 600199cce3ea0219bdd064ef6b7a3145cd306100..6e9b01c550cabf74e6e3a2eb7dc2963ffd7cbbb1 100644 |
--- a/runtime/observatory/lib/src/app/page.dart |
+++ b/runtime/observatory/lib/src/app/page.dart |
@@ -152,6 +152,12 @@ class VMPage extends MatchingPage { |
void _visit(Uri uri) { |
super._visit(uri); |
+ if (app.vm == null) { |
+ Logger.root.severe('VMPage has no VM'); |
+ // Reroute to vm-connect. |
+ app.locationManager.go(Uris.vmConnect()); |
+ return; |
+ } |
app.vm.reload().then((VM vm) { |
container.children = [ |
new VMViewElement(vm, app.events, app.notifications, |
@@ -161,7 +167,7 @@ class VMPage extends MatchingPage { |
}).catchError((e, stack) { |
Logger.root.severe('VMPage visit error: $e'); |
// Reroute to vm-connect. |
- app.locationManager.go(app.locationManager.makeLink('/vm-connect')); |
+ app.locationManager.go(Uris.vmConnect()); |
}); |
} |
} |