Index: content/common/mojo/mojo_shell_connection_impl.cc |
diff --git a/content/common/mojo/mojo_shell_connection_impl.cc b/content/common/mojo/mojo_shell_connection_impl.cc |
index 7528df61914d60213c96b637e043f7595d9ed956..e66aef0d1c0111775b07874b01d1287a032c2fc9 100644 |
--- a/content/common/mojo/mojo_shell_connection_impl.cc |
+++ b/content/common/mojo/mojo_shell_connection_impl.cc |
@@ -178,8 +178,10 @@ class MojoShellConnectionImpl::IOThreadContext |
// Note that this method may be invoked by MessageLoopObserver observing |
// MessageLoop destruction. In that case, this call to ShutDown is |
// effectively a no-op. In any case it's safe. |
- message_loop_observer_->ShutDown(); |
- message_loop_observer_ = nullptr; |
+ if (message_loop_observer_) { |
+ message_loop_observer_->ShutDown(); |
+ message_loop_observer_ = nullptr; |
+ } |
// Resetting the ServiceContext below may otherwise release the last |
// reference to this IOThreadContext. We keep it alive until the stack |