Browse Source

Fix crash caused by a focus element not having an owner document.

Lloyd Weehuizen 14 years ago
parent
commit
72712ce471
1 changed files with 2 additions and 1 deletions
  1. 2 1
      Source/Core/Context.cpp

+ 2 - 1
Source/Core/Context.cpp

@@ -628,7 +628,8 @@ void Context::ProcessMouseMove(int x, int y, int key_modifier_state)
 	
 	
 static Element* FindFocusElement(Element* element)
 static Element* FindFocusElement(Element* element)
 {
 {
-	if (element->GetOwnerDocument()->GetProperty< int >(FOCUS) == FOCUS_NONE)
+	ElementDocument* owner_document = element->GetOwnerDocument();
+	if (!owner_document || owner_document->GetProperty< int >(FOCUS) == FOCUS_NONE)
 		return NULL;
 		return NULL;
 	
 	
 	while (element && element->GetProperty< int >(FOCUS) == FOCUS_NONE)
 	while (element && element->GetProperty< int >(FOCUS) == FOCUS_NONE)