try t get DB in HasMsgOffline in case someone has cleared the cached db pointer out from under gloda, r=asuth, sr=standard8, 512414
authorDavid Bienvenu <bienvenu@nventure.com>
Sat, 29 Aug 2009 11:47:15 -0700
changeset 3448 2387346503a05714bde3821ed813357d6d5b3057
parent 3447 784c977804c84369cd2d65658c1e7c60e68e7315
child 3449 880ac704c5b75ddc9a19010239998daa1f16a027
push idunknown
push userunknown
push dateunknown
reviewersasuth, standard8, 512414
bugs512414
try t get DB in HasMsgOffline in case someone has cleared the cached db pointer out from under gloda, r=asuth, sr=standard8, 512414
mailnews/base/util/nsMsgDBFolder.cpp
--- a/mailnews/base/util/nsMsgDBFolder.cpp
+++ b/mailnews/base/util/nsMsgDBFolder.cpp
@@ -1216,16 +1216,17 @@ NS_IMETHODIMP nsMsgDBFolder::ShouldStore
   GetFlags(&flags);
   return flags & nsMsgFolderFlags::Offline ? MsgFitsDownloadCriteria(msgKey, result) : NS_OK;
 }
 
 NS_IMETHODIMP nsMsgDBFolder::HasMsgOffline(nsMsgKey msgKey, PRBool *result)
 {
   NS_ENSURE_ARG(result);
   *result = PR_FALSE;
+  GetDatabase();
   if(!mDatabase)
     return NS_ERROR_FAILURE;
 
   nsresult rv;
   nsCOMPtr<nsIMsgDBHdr> hdr;
   rv = mDatabase->GetMsgHdrForKey(msgKey, getter_AddRefs(hdr));
   if(NS_FAILED(rv))
     return rv;