Index: third_party/WebKit/Source/platform/inspector_protocol/lib/DispatcherBase_cpp.template |
diff --git a/third_party/WebKit/Source/platform/inspector_protocol/lib/DispatcherBase_cpp.template b/third_party/WebKit/Source/platform/inspector_protocol/lib/DispatcherBase_cpp.template |
index 4fdfbd55350b939f810725d275f235893d5ef2b4..76f77aae7ece7871d2db5e64aa626ea8f308a208 100644 |
--- a/third_party/WebKit/Source/platform/inspector_protocol/lib/DispatcherBase_cpp.template |
+++ b/third_party/WebKit/Source/platform/inspector_protocol/lib/DispatcherBase_cpp.template |
@@ -90,6 +90,8 @@ void DispatcherBase::sendResponse(int callId, const ErrorString& invocationError |
static void reportProtocolErrorTo(FrontendChannel* frontendChannel, int callId, DispatcherBase::CommonErrorCode code, const String& errorMessage, ErrorSupport* errors) |
{ |
+ if (!frontendChannel) |
+ return; |
std::unique_ptr<protocol::DictionaryValue> error = DictionaryValue::create(); |
error->setInteger("code", code); |
error->setString("message", errorMessage); |
@@ -104,8 +106,7 @@ static void reportProtocolErrorTo(FrontendChannel* frontendChannel, int callId, |
void DispatcherBase::reportProtocolError(int callId, CommonErrorCode code, const String& errorMessage, ErrorSupport* errors) |
{ |
- if (m_frontendChannel) |
- reportProtocolErrorTo(m_frontendChannel, callId, code, errorMessage, errors); |
+ reportProtocolErrorTo(m_frontendChannel, callId, code, errorMessage, errors); |
} |
void DispatcherBase::clearFrontend() |
@@ -141,7 +142,7 @@ void UberDispatcher::dispatch(std::unique_ptr<Value> parsedMessage) |
int callId = 0; |
protocol::Value* callIdValue = messageObject->get("id"); |
- bool success = callIdValue->asInteger(&callId); |
+ bool success = callIdValue && callIdValue->asInteger(&callId); |
if (!success) |
return; |