From a680982ab40e4099b130e43299622180d2600c3f Mon Sep 17 00:00:00 2001 From: "rods%netscape.com" Date: Thu, 26 Aug 1999 14:48:59 +0000 Subject: [PATCH] Put in check for null a mOptions and return zero for GetLength --- content/html/content/src/nsHTMLSelectElement.cpp | 5 +++-- layout/html/content/src/nsHTMLSelectElement.cpp | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/content/html/content/src/nsHTMLSelectElement.cpp b/content/html/content/src/nsHTMLSelectElement.cpp index f6e45524b88d..d82ef829c161 100644 --- a/content/html/content/src/nsHTMLSelectElement.cpp +++ b/content/html/content/src/nsHTMLSelectElement.cpp @@ -407,9 +407,10 @@ nsHTMLSelectElement::GetLength(PRUint32* aLength) { if (nsnull != mOptions) { Init(); + return mOptions->GetLength(aLength); } - - return mOptions->GetLength(aLength); + *aLength = 0; + return NS_ERROR_FAILURE; } static PRBool diff --git a/layout/html/content/src/nsHTMLSelectElement.cpp b/layout/html/content/src/nsHTMLSelectElement.cpp index f6e45524b88d..d82ef829c161 100644 --- a/layout/html/content/src/nsHTMLSelectElement.cpp +++ b/layout/html/content/src/nsHTMLSelectElement.cpp @@ -407,9 +407,10 @@ nsHTMLSelectElement::GetLength(PRUint32* aLength) { if (nsnull != mOptions) { Init(); + return mOptions->GetLength(aLength); } - - return mOptions->GetLength(aLength); + *aLength = 0; + return NS_ERROR_FAILURE; } static PRBool