fix crash in folder cache upon startup 55184 r=alecf

git-svn-id: svn://10.0.0.236/trunk@80392 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bienvenu%netscape.com
2000-10-05 00:45:55 +00:00
parent 8047b77647
commit 480b013d85

View File

@@ -209,6 +209,8 @@ nsresult nsMsgFolderCache::InitExistingDB()
rowCursor->Release();
}
}
else
err = NS_ERROR_FAILURE;
}
return err;
}
@@ -372,6 +374,14 @@ NS_IMETHODIMP nsMsgFolderCache::Init(nsIFileSpec *dbFileSpec)
PRBool exists = m_dbFileSpec.Exists();
// ### evil cast until MDB supports file streams.
rv = OpenMDB((const char *) m_dbFileSpec, exists);
// if this fails and panacea.dat exists, try blowing away the db and recreating it
if (!NS_SUCCEEDED(rv) && exists)
{
if (m_mdbStore)
m_mdbStore->Release();
m_dbFileSpec.Delete(PR_FALSE);
rv = OpenMDB((const char *) m_dbFileSpec, PR_FALSE);
}
}
}
return rv;