diff --git a/mozilla/editor/libeditor/html/nsHTMLObjectResizer.cpp b/mozilla/editor/libeditor/html/nsHTMLObjectResizer.cpp
index 0aef9226f37..cbf489c927c 100644
--- a/mozilla/editor/libeditor/html/nsHTMLObjectResizer.cpp
+++ b/mozilla/editor/libeditor/html/nsHTMLObjectResizer.cpp
@@ -1033,16 +1033,15 @@ nsHTMLEditor::CheckResizingState(nsISelection *aSelection)
}
}
- PRUint16 nodeType;
- focusNode->GetNodeType(&nodeType);
- if (nsIDOMNode::TEXT_NODE == nodeType) {
- nsCOMPtr parent;
- res = focusNode->GetParentNode(getter_AddRefs(parent));
- if (NS_FAILED(res)) return res;
- focusNode = parent;
- }
-
if (focusNode) {
+ PRUint16 nodeType;
+ focusNode->GetNodeType(&nodeType);
+ if (nsIDOMNode::TEXT_NODE == nodeType) {
+ nsCOMPtr parent;
+ res = focusNode->GetParentNode(getter_AddRefs(parent));
+ if (NS_FAILED(res)) return res;
+ focusNode = parent;
+ }
nsCOMPtrelement;
element = do_QueryInterface(focusNode);