From f9a24c5f08cf9b1f0b91213c0e813872f7972ece Mon Sep 17 00:00:00 2001 From: "mcmullen%netscape.com" Date: Tue, 6 Apr 1999 19:36:26 +0000 Subject: [PATCH] Checks for null --- xpfe/AppCores/src/nsPrefsCore.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/xpfe/AppCores/src/nsPrefsCore.cpp b/xpfe/AppCores/src/nsPrefsCore.cpp index 201e123f59b5..96747b540f92 100644 --- a/xpfe/AppCores/src/nsPrefsCore.cpp +++ b/xpfe/AppCores/src/nsPrefsCore.cpp @@ -709,10 +709,13 @@ NS_IMETHODIMP nsPrefsCore::SavePrefs() //---------------------------------------------------------------------------------------- { FinalizePrefWidgets(); - // Do the prefs stuff... - mPrefs->CopyPrefsTree("temp_tree", ""); - mPrefs->DeleteBranch("temp_tree"); - mPrefs->SavePrefFile(); + if (mPrefs) + { + // Do the prefs stuff... + mPrefs->CopyPrefsTree("temp_tree", ""); + mPrefs->DeleteBranch("temp_tree"); + mPrefs->SavePrefFile(); + } // Then close return Close(mPanelWindow); } @@ -722,7 +725,8 @@ NS_IMETHODIMP nsPrefsCore::CancelPrefs() //---------------------------------------------------------------------------------------- { // Do the prefs stuff... - mPrefs->DeleteBranch("temp_tree"); + if (mPrefs) + mPrefs->DeleteBranch("temp_tree"); // Then close return Close(mPanelWindow);