Index: chromeos/dbus/debug_daemon_client.cc |
diff --git a/chromeos/dbus/debug_daemon_client.cc b/chromeos/dbus/debug_daemon_client.cc |
index 23813a846ca69e890e0e2d484933f4fab260b68b..05d3b394ddce75695455ce808f9ccd1209c04f3f 100644 |
--- a/chromeos/dbus/debug_daemon_client.cc |
+++ b/chromeos/dbus/debug_daemon_client.cc |
@@ -470,7 +470,10 @@ class DebugDaemonClientImpl : public DebugDaemonClient { |
void OnRequestStopSystemTracing(dbus::Response* response) { |
if (!response) { |
LOG(ERROR) << "Failed to request systrace stop"; |
- pipe_reader_->OnDataReady(-1); // terminate data stream |
+ // If debugd crashes or completes I/O before this message is processed |
+ // then pipe_reader_ can be NULL, see OnIOComplete(). |
+ if (pipe_reader_.get()) |
+ pipe_reader_->OnDataReady(-1); // terminate data stream |
} |
// NB: requester is signaled when i/o completes |
} |