fix bug 562104, crash when subscribed to imap folder '/', r/sr=standard8
This commit is contained in:
Родитель
f5f18972f3
Коммит
f1a9d3be13
|
@ -1057,6 +1057,8 @@ NS_IMETHODIMP nsImapIncomingServer::PossibleImapMailbox(const nsACString& folder
|
||||||
if (dupFolderPath.Last() == '/')
|
if (dupFolderPath.Last() == '/')
|
||||||
{
|
{
|
||||||
dupFolderPath.SetLength(dupFolderPath.Length()-1);
|
dupFolderPath.SetLength(dupFolderPath.Length()-1);
|
||||||
|
if (dupFolderPath.IsEmpty())
|
||||||
|
return NS_ERROR_FAILURE;
|
||||||
// *** this is what we did in 4.x in order to list uw folder only
|
// *** this is what we did in 4.x in order to list uw folder only
|
||||||
// mailbox in order to get the \NoSelect flag
|
// mailbox in order to get the \NoSelect flag
|
||||||
explicitlyVerify = !(boxFlags & kNameSpace);
|
explicitlyVerify = !(boxFlags & kNameSpace);
|
||||||
|
@ -1165,7 +1167,8 @@ NS_IMETHODIMP nsImapIncomingServer::PossibleImapMailbox(const nsACString& folder
|
||||||
(kPublicMailbox | kOtherUsersMailbox | kPersonalMailbox))), &parentIsNew);
|
(kPublicMailbox | kOtherUsersMailbox | kPersonalMailbox))), &parentIsNew);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
hostFolder->CreateClientSubfolderInfo(dupFolderPath, hierarchyDelimiter,boxFlags, PR_FALSE);
|
rv = hostFolder->CreateClientSubfolderInfo(dupFolderPath, hierarchyDelimiter,boxFlags, PR_FALSE);
|
||||||
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
caseInsensitive = MsgLowerCaseEqualsLiteral(dupFolderPath, "inbox");
|
caseInsensitive = MsgLowerCaseEqualsLiteral(dupFolderPath, "inbox");
|
||||||
a_nsIFolder->GetChildWithURI(uri, PR_TRUE, caseInsensitive, getter_AddRefs(child));
|
a_nsIFolder->GetChildWithURI(uri, PR_TRUE, caseInsensitive, getter_AddRefs(child));
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,6 +59,16 @@ const gTestArray =
|
||||||
QueryInterface(Ci.nsIMsgImapMailFolder);
|
QueryInterface(Ci.nsIMsgImapMailFolder);
|
||||||
newChild.updateFolderWithListener(null, UrlListener);
|
newChild.updateFolderWithListener(null, UrlListener);
|
||||||
},
|
},
|
||||||
|
function checkEmptyFolder() {
|
||||||
|
try {
|
||||||
|
let serverSink = gLocalServer.QueryInterface(Ci.nsIImapServerSink);
|
||||||
|
serverSink.possibleImapMailbox("/", '/', 0);
|
||||||
|
}
|
||||||
|
catch (ex) {
|
||||||
|
// we expect this to fail, but not crash or assert.
|
||||||
|
}
|
||||||
|
do_timeout_function(0, function(){doTest(++gCurTestNum)});
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
function endTest()
|
function endTest()
|
||||||
|
@ -80,7 +90,7 @@ function doTest(test)
|
||||||
|
|
||||||
var testFn = gTestArray[test-1];
|
var testFn = gTestArray[test-1];
|
||||||
// Set a limit of 10 seconds; if the notifications haven't arrived by then there's a problem.
|
// Set a limit of 10 seconds; if the notifications haven't arrived by then there's a problem.
|
||||||
do_timeout(10000, function(){
|
do_timeout_function(10000, function(){
|
||||||
if (gCurTestNum == test)
|
if (gCurTestNum == test)
|
||||||
do_throw("Notifications not received in 10000 ms for operation " + testFn.name +
|
do_throw("Notifications not received in 10000 ms for operation " + testFn.name +
|
||||||
", current status is " + gCurrStatus);
|
", current status is " + gCurrStatus);
|
||||||
|
@ -113,6 +123,6 @@ var UrlListener =
|
||||||
// This can happen with a bunch of synchronous functions grouped together, and
|
// This can happen with a bunch of synchronous functions grouped together, and
|
||||||
// can even cause tests to fail because they're still waiting for the listener
|
// can even cause tests to fail because they're still waiting for the listener
|
||||||
// to return
|
// to return
|
||||||
do_timeout(0, function(){doTest(++gCurTestNum)});
|
do_timeout_function(0, function(){doTest(++gCurTestNum)});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Загрузка…
Ссылка в новой задаче