Add wxCHECK_MSG() to wxGTK RunScript() implementation too

Don't crash if RunScript() is called on a not yet created object.

This is also consistent with the macOS version of the code.
This commit is contained in:
Vadim Zeitlin
2017-10-21 23:38:46 +02:00
parent 9884b0b4ea
commit 70c8979223
2 changed files with 6 additions and 0 deletions

View File

@@ -1172,6 +1172,9 @@ bool wxWebViewWebKit::RunScriptSync(const wxString& javascript, wxString* output
bool wxWebViewWebKit::RunScript(const wxString& javascript, wxString* output)
{
wxCHECK_MSG( m_web_view, false,
wxS("wxWebView must be created before calling RunScript()") );
wxJSScriptWrapper wrapJS(javascript, &m_runScriptCount);
wxString result;