From 8fee3c22cb551a23b789eadfeabf5a65a29bc2f0 Mon Sep 17 00:00:00 2001 From: "erik%netscape.com" Date: Tue, 23 Nov 1999 00:12:36 +0000 Subject: [PATCH] bug 8801; better error handling for new font enumerator; r=ftang git-svn-id: svn://10.0.0.236/trunk@54220 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/gfx/src/windows/nsFontMetricsWin.cpp | 25 ++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/mozilla/gfx/src/windows/nsFontMetricsWin.cpp b/mozilla/gfx/src/windows/nsFontMetricsWin.cpp index 4225874c7a2..66602c36fca 100644 --- a/mozilla/gfx/src/windows/nsFontMetricsWin.cpp +++ b/mozilla/gfx/src/windows/nsFontMetricsWin.cpp @@ -2708,7 +2708,16 @@ CompareFontNames(const void* aArg1, const void* aArg2, void* aClosure) NS_IMETHODIMP nsFontEnumeratorWin::EnumerateAllFonts(PRUint32* aCount, PRUnichar*** aResult) { - if ((!aCount) || (!aResult)) { + if (aCount) { + *aCount = 0; + } + else { + return NS_ERROR_NULL_POINTER; + } + if (aResult) { + *aResult = nsnull; + } + else { return NS_ERROR_NULL_POINTER; } @@ -2831,7 +2840,19 @@ NS_IMETHODIMP nsFontEnumeratorWin::EnumerateFonts(const char* aLangGroup, const char* aGeneric, PRUint32* aCount, PRUnichar*** aResult) { - if ((!aLangGroup) || (!aGeneric) || (!aCount) || (!aResult)) { + if ((!aLangGroup) || (!aGeneric)) { + return NS_ERROR_NULL_POINTER; + } + if (aCount) { + *aCount = 0; + } + else { + return NS_ERROR_NULL_POINTER; + } + if (aResult) { + *aResult = nsnull; + } + else { return NS_ERROR_NULL_POINTER; }