mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-25 18:07:31 +09:00
Bug 646901 - add error checking to fix crash in nsMsgXFVirtualFolderDBView::OnSearchHit().
dbToUse was null Rag #1273
This commit is contained in:
parent
eaac1c967d
commit
3141e9940a
1 changed files with 8 additions and 7 deletions
|
|
@ -251,10 +251,6 @@ nsMsgXFVirtualFolderDBView::OnSearchHit(nsIMsgDBHdr* aMsgHdr, nsIMsgFolder *aFol
|
||||||
NS_ENSURE_ARG(aMsgHdr);
|
NS_ENSURE_ARG(aMsgHdr);
|
||||||
NS_ENSURE_ARG(aFolder);
|
NS_ENSURE_ARG(aFolder);
|
||||||
|
|
||||||
nsCOMPtr<nsIMsgDatabase> dbToUse;
|
|
||||||
nsCOMPtr<nsIDBFolderInfo> folderInfo;
|
|
||||||
aFolder->GetDBFolderInfoAndDB(getter_AddRefs(folderInfo), getter_AddRefs(dbToUse));
|
|
||||||
|
|
||||||
if (m_curFolderGettingHits != aFolder && m_doingSearch && !m_doingQuickSearch)
|
if (m_curFolderGettingHits != aFolder && m_doingSearch && !m_doingQuickSearch)
|
||||||
{
|
{
|
||||||
m_curFolderHasCachedHits = false;
|
m_curFolderHasCachedHits = false;
|
||||||
|
|
@ -267,11 +263,16 @@ nsMsgXFVirtualFolderDBView::OnSearchHit(nsIMsgDBHdr* aMsgHdr, nsIMsgFolder *aFol
|
||||||
m_curFolderStartKeyIndex = m_keys.Length();
|
m_curFolderStartKeyIndex = m_keys.Length();
|
||||||
}
|
}
|
||||||
bool hdrInCache = false;
|
bool hdrInCache = false;
|
||||||
nsCString searchUri;
|
|
||||||
if (!m_doingQuickSearch)
|
if (!m_doingQuickSearch)
|
||||||
{
|
{
|
||||||
m_viewFolder->GetURI(searchUri);
|
nsCOMPtr<nsIMsgDatabase> dbToUse;
|
||||||
dbToUse->HdrIsInCache(searchUri.get(), aMsgHdr, &hdrInCache);
|
nsCOMPtr<nsIDBFolderInfo> dummyInfo;
|
||||||
|
nsresult rv = aFolder->GetDBFolderInfoAndDB(getter_AddRefs(dummyInfo), getter_AddRefs(dbToUse));
|
||||||
|
if (NS_SUCCEEDED(rv)) {
|
||||||
|
nsCString searchUri;
|
||||||
|
m_viewFolder->GetURI(searchUri);
|
||||||
|
dbToUse->HdrIsInCache(searchUri.get(), aMsgHdr, &hdrInCache);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!m_doingSearch || !m_curFolderHasCachedHits || !hdrInCache)
|
if (!m_doingSearch || !m_curFolderHasCachedHits || !hdrInCache)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue