diff --git a/mailnews/base/src/nsMessengerWinIntegration.cpp b/mailnews/base/src/nsMessengerWinIntegration.cpp index ea75a3abe9f..23e0e3ba722 100644 --- a/mailnews/base/src/nsMessengerWinIntegration.cpp +++ b/mailnews/base/src/nsMessengerWinIntegration.cpp @@ -582,10 +582,12 @@ nsresult nsMessengerWinIntegration::AlertFinished() // okay, we are done showing the alert // now put an icon in the system tray, if allowed PRBool showTrayIcon = !mSuppressBiffIcon; - nsresult rv; - nsCOMPtr prefBranch(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv)); - if (NS_SUCCEEDED(rv) && prefBranch) - prefBranch->GetBoolPref(SHOW_TRAY_ICON_PREF, &showTrayIcon); + if (showTrayIcon) + { + nsCOMPtr prefBranch(do_GetService(NS_PREFSERVICE_CONTRACTID)); + if (prefBranch) + prefBranch->GetBoolPref(SHOW_TRAY_ICON_PREF, &showTrayIcon); + } if (showTrayIcon) { GenericShellNotify(NIM_ADD);