diff --git a/mozilla/editor/libeditor/html/nsHTMLDataTransfer.cpp b/mozilla/editor/libeditor/html/nsHTMLDataTransfer.cpp
index f947bde5edb..d4024d8148c 100644
--- a/mozilla/editor/libeditor/html/nsHTMLDataTransfer.cpp
+++ b/mozilla/editor/libeditor/html/nsHTMLDataTransfer.cpp
@@ -2816,14 +2816,14 @@ nsHTMLEditor::ReplaceOrphanedStructure(PRBool aEnd,
nsIDOMNode* nsHTMLEditor::GetArrayEndpoint(PRBool aEnd,
nsCOMArray& aNodeArray)
{
+ PRInt32 listCount = aNodeArray.Count();
+ if (listCount <= 0)
+ return nsnull;
+
if (aEnd)
{
- PRInt32 listCount = aNodeArray.Count();
- if (listCount <= 0) return nsnull;
- else return aNodeArray[listCount-1];
- }
- else
- {
- return aNodeArray[0];
+ return aNodeArray[listCount-1];
}
+
+ return aNodeArray[0];
}