Fix for 48812. submitted by Gemal. r=scottip. Some null ptr checks.

This commit is contained in:
putterman%netscape.com 2000-08-18 22:49:31 +00:00
Родитель 7ab85b808d
Коммит f24b877c97
1 изменённых файлов: 21 добавлений и 16 удалений

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

@ -91,11 +91,13 @@ function MsgCopyMessage(destFolder)
destMsgFolder = destResource.QueryInterface(Components.interfaces.nsIMsgFolder);
var srcFolder = GetLoadedMsgFolder();
var compositeDataSource = GetCompositeDataSource("Copy");
var messages = GetSelectedMessages();
if(srcFolder)
{
var compositeDataSource = GetCompositeDataSource("Copy");
var messages = GetSelectedMessages();
CopyMessages(compositeDataSource, srcFolder, destMsgFolder, messages, false);
CopyMessages(compositeDataSource, srcFolder, destMsgFolder, messages, false);
}
}
function MsgMoveMessage(destFolder)
@ -106,20 +108,23 @@ function MsgMoveMessage(destFolder)
destMsgFolder = destResource.QueryInterface(Components.interfaces.nsIMsgFolder);
var srcFolder = GetLoadedMsgFolder();
var compositeDataSource = GetCompositeDataSource("Move");
var messages = GetSelectedMessages();
var srcResource = srcFolder.QueryInterface(Components.interfaces.nsIRDFResource);
var srcUri = srcResource.Value;
if (srcUri.substring(0,6) == "news:/")
if(srcFolder)
{
CopyMessages(compositeDataSource, srcFolder, destMsgFolder, messages, false);
}
else
{
SetNextMessageAfterDelete(null, true);
var compositeDataSource = GetCompositeDataSource("Move");
var messages = GetSelectedMessages();
CopyMessages(compositeDataSource, srcFolder, destMsgFolder, messages, true);
var srcResource = srcFolder.QueryInterface(Components.interfaces.nsIRDFResource);
var srcUri = srcResource.Value;
if (srcUri.substring(0,6) == "news:/")
{
CopyMessages(compositeDataSource, srcFolder, destMsgFolder, messages, false);
}
else
{
SetNextMessageAfterDelete(null, true);
CopyMessages(compositeDataSource, srcFolder, destMsgFolder, messages, true);
}
}
}