Commit 706898dc authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

vbscript: Don't allow changing script state when script site is not set.

parent e343fcaf
......@@ -713,6 +713,11 @@ static void test_vbscript_uninitializing(void)
test_no_script_dispatch(script);
hres = IActiveScript_SetScriptState(script, SCRIPTSTATE_STARTED);
ok(hres == E_UNEXPECTED, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres);
hres = IActiveScript_SetScriptState(script, SCRIPTSTATE_INITIALIZED);
ok(hres == E_UNEXPECTED, "SetScriptState(SCRIPTSTATE_INITIALIZED) failed: %08x\n", hres);
SET_EXPECT(GetLCID);
SET_EXPECT(OnStateChange_INITIALIZED);
hres = IActiveScript_SetScriptSite(script, &ActiveScriptSite);
......
......@@ -457,7 +457,7 @@ static HRESULT WINAPI VBScript_SetScriptState(IActiveScript *iface, SCRIPTSTATE
return S_OK;
}
if(!This->is_initialized)
if(!This->is_initialized || !This->ctx->site)
return E_UNEXPECTED;
switch(ss) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment