diff options
Diffstat (limited to 'mash')
-rw-r--r-- | mash/shell/shell_application_delegate.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/mash/shell/shell_application_delegate.cc b/mash/shell/shell_application_delegate.cc index 68c01fd..4c2196e 100644 --- a/mash/shell/shell_application_delegate.cc +++ b/mash/shell/shell_application_delegate.cc @@ -117,8 +117,12 @@ void ShellApplicationDelegate::StartRestartableService( // TODO(beng): This would be the place to insert logic that counted restarts // to avoid infinite crash-restart loops. scoped_ptr<mojo::Connection> connection = shell_->Connect(url); - connection->SetRemoteServiceProviderConnectionErrorHandler(restart_callback); - connections_[url] = std::move(connection); + // Note: |connection| may be null if we've lost our connection to the shell. + if (connection) { + connection->SetRemoteServiceProviderConnectionErrorHandler( + restart_callback); + connections_[url] = std::move(connection); + } } } // namespace shell |