From 1f14babe7468ba579b81cb9525f2c32fe5e02b9c Mon Sep 17 00:00:00 2001 From: Eric Rahm Date: Tue, 14 Jul 2015 17:52:25 -0700 Subject: [PATCH] Bug 1183891 - Remove warning if invalid node type is passed to nsRange::SetStart. r=smaug --- dom/base/nsRange.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dom/base/nsRange.cpp b/dom/base/nsRange.cpp index 44550bad5b57..81fe2568e703 100644 --- a/dom/base/nsRange.cpp +++ b/dom/base/nsRange.cpp @@ -1129,7 +1129,9 @@ nsRange::SetStart(nsIDOMNode* aParent, int32_t aOffset) nsRange::SetStart(nsINode* aParent, int32_t aOffset) { nsINode* newRoot = IsValidBoundary(aParent); - NS_ENSURE_TRUE(newRoot, NS_ERROR_DOM_INVALID_NODE_TYPE_ERR); + if (!newRoot) { + return NS_ERROR_DOM_INVALID_NODE_TYPE_ERR; + } if (aOffset < 0 || uint32_t(aOffset) > aParent->Length()) { return NS_ERROR_DOM_INDEX_SIZE_ERR;