diff --git a/shell/browser/api/electron_api_web_contents.h b/shell/browser/api/electron_api_web_contents.h index 639de8f3b08..acf560fb78f 100644 --- a/shell/browser/api/electron_api_web_contents.h +++ b/shell/browser/api/electron_api_web_contents.h @@ -338,7 +338,7 @@ class WebContents : public gin::Wrappable, } void RemoveObserver(ExtendedWebContentsObserver* obs) { // Trying to remove from an empty collection leads to an access violation - if (observers_.might_have_observers()) + if (!observers_.empty()) observers_.RemoveObserver(obs); }