Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(864)

Unified Diff: third_party/WebKit/Source/platform/v8_inspector/V8InspectorSessionImpl.cpp

Issue 2158363004: [DevTools] Avoid dereferencing null pointer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/v8_inspector/V8InspectorSessionImpl.cpp
diff --git a/third_party/WebKit/Source/platform/v8_inspector/V8InspectorSessionImpl.cpp b/third_party/WebKit/Source/platform/v8_inspector/V8InspectorSessionImpl.cpp
index 88aac8c894d41a7bb24fc6bd2a5dc1f66eb28158..fc13b3dc783e4f69ca983d060e51a99e53679f67 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/V8InspectorSessionImpl.cpp
+++ b/third_party/WebKit/Source/platform/v8_inspector/V8InspectorSessionImpl.cpp
@@ -139,7 +139,12 @@ InjectedScript* V8InspectorSessionImpl::findInjectedScript(ErrorString* errorStr
}
const V8DebuggerImpl::ContextByIdMap* contexts = m_debugger->contextGroup(m_contextGroupId);
- auto contextsIt = contexts ? contexts->find(contextId) : contexts->end();
+ if (!contexts) {
+ *errorString = "Cannot find context with specified id";
+ return nullptr;
+ }
+
+ auto contextsIt = contexts->find(contextId);
if (contextsIt == contexts->end()) {
*errorString = "Cannot find context with specified id";
return nullptr;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698