diff options
author | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-20 19:19:20 +0000 |
---|---|---|
committer | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-20 19:19:20 +0000 |
commit | 233ee5d5b15c0846e69f82306ff0118592d3270c (patch) | |
tree | bde40f51a0f9c2735f1b4ad8c491f9385b7bd5a2 /chrome_frame | |
parent | 8cec5fa2488d84dcb0c4fe89ca72c027068b8792 (diff) | |
download | chromium_src-233ee5d5b15c0846e69f82306ff0118592d3270c.zip chromium_src-233ee5d5b15c0846e69f82306ff0118592d3270c.tar.gz chromium_src-233ee5d5b15c0846e69f82306ff0118592d3270c.tar.bz2 |
Check the container for NULLness before dereferencing.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/2117021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47826 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame')
-rw-r--r-- | chrome_frame/com_message_event.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/chrome_frame/com_message_event.cc b/chrome_frame/com_message_event.cc index 5ec982a..ce4f016 100644 --- a/chrome_frame/com_message_event.cc +++ b/chrome_frame/com_message_event.cc @@ -18,7 +18,7 @@ bool ComMessageEvent::Initialize(IOleContainer* container, const std::string& message, const std::string& origin, const std::string& event_type) { - DCHECK(container); + DLOG_IF(WARNING, !container) << __FUNCTION__ << " no container"; message_ = message; origin_ = origin; type_ = event_type; @@ -27,8 +27,10 @@ bool ComMessageEvent::Initialize(IOleContainer* container, ScopedComPtr<IHTMLEventObj> basic_event; ScopedComPtr<IHTMLDocument2> doc; - // Fetching doc may fail in non-IE containers. - container->QueryInterface(doc.Receive()); + // Fetching doc may fail in non-IE containers + // and container might be NULL in some applications. + if (container) + container->QueryInterface(doc.Receive()); if (doc) { ScopedComPtr<IHTMLDocument4> doc4; doc4.QueryFrom(doc); |