From 26939801f6799a4d449d4097ea2ca6b1e166fe02 Mon Sep 17 00:00:00 2001 From: bridiver Date: Thu, 23 Apr 2020 09:15:29 -0700 Subject: [PATCH] check for empty content setting rules fix https://github.com/brave/brave-browser/issues/9421 --- renderer/brave_content_settings_agent_impl.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/renderer/brave_content_settings_agent_impl.cc b/renderer/brave_content_settings_agent_impl.cc index 3bacb2884404..355521ed4552 100644 --- a/renderer/brave_content_settings_agent_impl.cc +++ b/renderer/brave_content_settings_agent_impl.cc @@ -70,7 +70,6 @@ ContentSetting GetBraveContentSettingFromRules( return rule.GetContentSetting(); } } - NOTREACHED(); return CONTENT_SETTING_DEFAULT; } @@ -276,9 +275,13 @@ bool BraveContentSettingsAgentImpl::AllowFingerprinting( BraveFarblingLevel BraveContentSettingsAgentImpl::GetBraveFarblingLevel() { blink::WebLocalFrame* frame = render_frame()->GetWebFrame(); - ContentSetting setting = GetBraveContentSettingFromRules( + + ContentSetting setting = CONTENT_SETTING_DEFAULT; + if (content_setting_rules_) { + setting = GetBraveContentSettingFromRules( content_setting_rules_->fingerprinting_rules, frame, url::Origin(frame->GetDocument().GetSecurityOrigin()).GetURL()); + } if (base::FeatureList::IsEnabled( brave_shields::features::kFingerprintingProtectionV2)) {