diff --git a/layout/forms/nsListControlFrame.cpp b/layout/forms/nsListControlFrame.cpp index c3d52fa1e26..71e65069274 100644 --- a/layout/forms/nsListControlFrame.cpp +++ b/layout/forms/nsListControlFrame.cpp @@ -1007,7 +1007,7 @@ nsIContent * nsListControlFrame::GetOptionFromContent(nsIContent *aContent) { nsIContent * content = aContent; - NS_ADDREF(content); + NS_IF_ADDREF(content); while (nsnull != content) { if (IsOptionElement(content)) { return content; diff --git a/layout/html/forms/src/nsListControlFrame.cpp b/layout/html/forms/src/nsListControlFrame.cpp index c3d52fa1e26..71e65069274 100644 --- a/layout/html/forms/src/nsListControlFrame.cpp +++ b/layout/html/forms/src/nsListControlFrame.cpp @@ -1007,7 +1007,7 @@ nsIContent * nsListControlFrame::GetOptionFromContent(nsIContent *aContent) { nsIContent * content = aContent; - NS_ADDREF(content); + NS_IF_ADDREF(content); while (nsnull != content) { if (IsOptionElement(content)) { return content;