File tree 1 file changed +10
-2
lines changed
browser/ui/webui/brave_shields 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -186,17 +186,25 @@ void ShieldsPanelDataHandler::OpenWebCompatWindow() {
186
186
187
187
void ShieldsPanelDataHandler::AreAnyBlockedElementsPresent (
188
188
AreAnyBlockedElementsPresentCallback callback) {
189
+ if (!active_shields_data_controller_) {
190
+ return ;
191
+ }
192
+
189
193
std::move (callback).Run (
190
194
g_brave_browser_process->ad_block_service ()->AreAnyBlockedElementsPresent (
191
195
active_shields_data_controller_->web_contents ()->GetURL ().host ()));
192
196
}
193
197
194
198
void ShieldsPanelDataHandler::ResetBlockedElements () {
199
+ webui_controller_->embedder ()->CloseUI ();
200
+
201
+ if (!active_shields_data_controller_) {
202
+ return ;
203
+ }
204
+
195
205
g_brave_browser_process->ad_block_service ()->ResetCosmeticFilter (
196
206
active_shields_data_controller_->web_contents ()->GetURL ().host ());
197
207
198
- webui_controller_->embedder ()->CloseUI ();
199
-
200
208
active_shields_data_controller_->web_contents ()->GetController ().Reload (
201
209
content::ReloadType::NORMAL, true );
202
210
}
You can’t perform that action at this time.
0 commit comments