Created
November 3, 2015 00:03
-
-
Save abarth/fba6c001c52fe34c96e2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/sky/packages/sky/lib/src/services/shell.dart b/sky/packages/sky/lib/src/services/shell.dart | |
index 86856c8..cacd14e 100644 | |
--- a/sky/packages/sky/lib/src/services/shell.dart | |
+++ b/sky/packages/sky/lib/src/services/shell.dart | |
@@ -29,10 +29,10 @@ ShellProxy _initShellProxy() { | |
ApplicationConnection _initEmbedderConnection() { | |
core.MojoHandle servicesHandle = new core.MojoHandle(internals.takeServicesProvidedByEmbedder()); | |
core.MojoHandle exposedServicesHandle = new core.MojoHandle(internals.takeServicesProvidedToEmbedder()); | |
- ServiceProviderProxy services = servicesHandle.isValid ? | |
- new ServiceProviderProxy.fromHandle(servicesHandle) : null; | |
- ServiceProviderStub exposedServices = exposedServicesHandle.isValid ? | |
- new ServiceProviderStub.fromHandle(exposedServicesHandle) : null; | |
+ if (!servicesHandle.isValid || !exposedServicesHandle.isValid) | |
+ return null; | |
+ ServiceProviderProxy services = new ServiceProviderProxy.fromHandle(servicesHandle); | |
+ ServiceProviderStub exposedServices = new ServiceProviderStub.fromHandle(exposedServicesHandle); | |
return new ApplicationConnection(exposedServices, services); | |
} | |
@@ -56,7 +56,7 @@ class _Shell { | |
if (_shell == null || url == null) { | |
// If we don't have a shell or a url, we try to get the services from the | |
// embedder directly instead of using the shell to connect. | |
- _embedderConnection.requestService(proxy); | |
+ _embedderConnection?.requestService(proxy); | |
return; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment