84767 r=suresh sr=mscott a=blizzard; make sure m_curFilter is not null. m_curFilter

may be null if there is no name for a filter in rules.dat.
This commit is contained in:
naving%netscape.com 2001-06-15 21:54:48 +00:00
Родитель e8ff63b0bb
Коммит 43a63d53b9
1 изменённых файлов: 21 добавлений и 18 удалений

Просмотреть файл

@ -507,25 +507,28 @@ nsresult nsMsgFilterList::LoadTextFilters(nsIOFileStream *aStream)
m_curFilter->SetFilterScript(&value);
break;
case nsIMsgFilterList::attribAction:
m_curFilter->m_action.m_type = nsMsgFilter::GetActionForFilingStr(value);
break;
if (m_curFilter)
m_curFilter->m_action.m_type = nsMsgFilter::GetActionForFilingStr(value);
break;
case nsIMsgFilterList::attribActionValue:
if (m_curFilter->m_action.m_type == nsMsgFilterAction::MoveToFolder)
err = m_curFilter->ConvertMoveToFolderValue(value);
else if (m_curFilter->m_action.m_type == nsMsgFilterAction::ChangePriority)
{
nsMsgPriorityValue outPriority;
nsresult res = NS_MsgGetPriorityFromString(value.get(), &outPriority);
if (NS_SUCCEEDED(res))
{
m_curFilter->SetAction(m_curFilter->m_action.m_type);
m_curFilter->SetActionPriority(outPriority);
}
else
NS_ASSERTION(PR_FALSE, "invalid priority in filter file");
}
break;
if (m_curFilter)
{
if (m_curFilter->m_action.m_type == nsMsgFilterAction::MoveToFolder)
err = m_curFilter->ConvertMoveToFolderValue(value);
else if (m_curFilter->m_action.m_type == nsMsgFilterAction::ChangePriority)
{
nsMsgPriorityValue outPriority;
nsresult res = NS_MsgGetPriorityFromString(value.get(), &outPriority);
if (NS_SUCCEEDED(res))
{
m_curFilter->SetAction(m_curFilter->m_action.m_type);
m_curFilter->SetActionPriority(outPriority);
}
else
NS_ASSERTION(PR_FALSE, "invalid priority in filter file");
}
}
break;
case nsIMsgFilterList::attribCondition:
err = ParseCondition(value);
break;