Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[embedlite] Check presence of event handler before using it
It might happen that a web view is requested to be closed programattically
from JavaScript, but not closed yet. During this time frame event handler
is NULL already and can't be used.
  • Loading branch information
rojkov committed Jun 11, 2015
1 parent d21c7f8 commit 6bf67df
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions embedding/embedlite/utils/WebBrowserChrome.cpp
Expand Up @@ -571,8 +571,10 @@ NS_IMETHODIMP WebBrowserChrome::GetTitle(char16_t** aTitle)
NS_IMETHODIMP WebBrowserChrome::SetTitle(const char16_t* aTitle)
{
// Store local title
mTitle = aTitle;
mListener->OnTitleChanged(mTitle.get());
mTitle.Assign(nsDependentString(aTitle));
if (mListener) {
mListener->OnTitleChanged(mTitle.get());
}
return NS_OK;
}

Expand Down

0 comments on commit 6bf67df

Please sign in to comment.