diff --git a/content/base/src/nsRange.cpp b/content/base/src/nsRange.cpp index 35f93eb1fd41..cdc305289b7e 100644 --- a/content/base/src/nsRange.cpp +++ b/content/base/src/nsRange.cpp @@ -813,12 +813,14 @@ nsresult nsRange::PopRanges(nsIDOMNode* aDestNode, PRInt32 aOffset, nsIContent* // promote start point up to replacement point res = theRange->SetStart(aDestNode, aOffset); NS_POSTCONDITION(NS_SUCCEEDED(res), "nsRange::PopRanges() got error from SetStart()"); + if (NS_FAILED(res)) return res; } if (theRange->mEndParent == domNode) { // promote end point up to replacement point res = theRange->SetEnd(aDestNode, aOffset); NS_POSTCONDITION(NS_SUCCEEDED(res), "nsRange::PopRanges() got error from SetEnd()"); + if (NS_FAILED(res)) return res; } } // must refresh theRangeList - it might have gone away! diff --git a/layout/base/src/nsRange.cpp b/layout/base/src/nsRange.cpp index 35f93eb1fd41..cdc305289b7e 100644 --- a/layout/base/src/nsRange.cpp +++ b/layout/base/src/nsRange.cpp @@ -813,12 +813,14 @@ nsresult nsRange::PopRanges(nsIDOMNode* aDestNode, PRInt32 aOffset, nsIContent* // promote start point up to replacement point res = theRange->SetStart(aDestNode, aOffset); NS_POSTCONDITION(NS_SUCCEEDED(res), "nsRange::PopRanges() got error from SetStart()"); + if (NS_FAILED(res)) return res; } if (theRange->mEndParent == domNode) { // promote end point up to replacement point res = theRange->SetEnd(aDestNode, aOffset); NS_POSTCONDITION(NS_SUCCEEDED(res), "nsRange::PopRanges() got error from SetEnd()"); + if (NS_FAILED(res)) return res; } } // must refresh theRangeList - it might have gone away!