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

Unified Diff: third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp

Issue 2484903002: DevTools: fix a crash in stopRuleUsageTracking (Closed)
Patch Set: stopRuleUsageTracking crash fixed Created 4 years, 1 month 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
Index: third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
diff --git a/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
index de63a15e1b0eb8c7802aa4b3575546b0fb4c5417..00bcca6123ac82b211e3336b6e16277902eb6b2c 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
@@ -2527,8 +2527,12 @@ Response InspectorCSSAgent::stopRuleUsageTracking(
StyleRule* styleRule = cssRule->styleRule();
- result->get()->addItem(
- buildObjectForRuleUsage(cssRule, m_tracker->contains(styleRule)));
+ std::unique_ptr<protocol::CSS::RuleUsage> protocolRule =
+ buildObjectForRuleUsage(cssRule, m_tracker->contains(styleRule));
+ if (!protocolRule)
+ continue;
+
+ result->get()->addItem(std::move(protocolRule));
}
}
}

Powered by Google App Engine
This is Rietveld 408576698