| Index: src/plugin/PluginClass.cpp |
| =================================================================== |
| --- a/src/plugin/PluginClass.cpp |
| +++ b/src/plugin/PluginClass.cpp |
| @@ -170,12 +170,12 @@ |
| if (m_webBrowser2) |
| { |
| CComBSTR bstrURL; |
| - if (SUCCEEDED(m_webBrowser2->get_LocationURL(&bstrURL)) && bstrURL) |
| + if (SUCCEEDED(m_webBrowser2->get_LocationURL(&bstrURL))) |
| { |
| - url = std::wstring(bstrURL, SysStringLen(bstrURL)); |
| + url = ToWstring(bstrURL); |
| } |
| } |
| - else |
| + if (url.empty()) |
| { |
| DEBUG_ERROR_LOG(0, 0, 0, "CPluginClass::GetBrowserUrl - Reached with m_webBrowser2 == nullptr"); |
|
sergei
2016/01/11 15:39:07
The comment is slightly inconsistent now with the
Eric
2016/01/11 15:59:33
Yeah. I'll fix that. That's an invariant violation
|
| url = m_tab->GetDocumentUrl(); |
| @@ -474,7 +474,7 @@ |
| { |
| return; |
| } |
| - std::wstring url(urlVariant->bstrVal, SysStringLen(urlVariant->bstrVal)); |
| + std::wstring url = ToWstring(urlVariant->bstrVal); |
| // If webbrowser2 is equal to top level browser (as set in SetSite), we are |
| // navigating new page |