diff --git a/dlls/mshtml/tests/script.c b/dlls/mshtml/tests/script.c
index 8b15d92faff..ac604cce06d 100644
--- a/dlls/mshtml/tests/script.c
+++ b/dlls/mshtml/tests/script.c
@@ -432,7 +432,10 @@ static void test_simple_script(void)
IHTMLDocument2 *doc;
SET_EXPECT(CreateInstance);
+
doc = create_and_load_doc(simple_script_str);
+ if(!doc) return;
+
CHECK_CALLED(CreateInstance);
IHTMLDocument2_Release(doc);