diff --git a/dlls/mshtml/view.c b/dlls/mshtml/view.c
index a201de0317..e5ef7a7419 100644
--- a/dlls/mshtml/view.c
+++ b/dlls/mshtml/view.c
@@ -577,7 +577,8 @@ static HRESULT WINAPI OleDocumentView_UIActivate(IOleDocumentView *iface, BOOL f
}
This->focus = TRUE;
- nsIWebBrowserFocus_Activate(This->nscontainer->focus);
+ if(This->nscontainer)
+ nsIWebBrowserFocus_Activate(This->nscontainer->focus);
notif_focus(This);
update_doc(This, UPDATE_UI);