Bug 448165 Mailnews crashes in [@ nsAbMDBDirectory::DeleteCards] if aCards is null. r=me,sr=bienvenu
This commit is contained in:
Родитель
2c37c47c71
Коммит
24ad7f7ded
|
@ -460,6 +460,7 @@ NS_IMETHODIMP nsAbMDBDirectory::GetChildCards(nsISimpleEnumerator* *result)
|
|||
|
||||
NS_IMETHODIMP nsAbMDBDirectory::DeleteCards(nsIArray *aCards)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aCards);
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
if (mIsQueryURI) {
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
/**
|
||||
* A simple test to check for a regression of bug 448165: Mailnews crashes in
|
||||
* nsAbMDBDirectory::DeleteCards if aCards is null
|
||||
*/
|
||||
function run_test() {
|
||||
// get the Address Book Manager service
|
||||
var abManager = Cc["@mozilla.org/abmanager;1"].getService(Ci.nsIAbManager);
|
||||
// get the Personal Address Book
|
||||
var pab = abManager.getDirectory(kPABData.URI);
|
||||
do_check_true(pab instanceof Ci.nsIAbDirectory);
|
||||
try {
|
||||
pab.deleteCards(null); // this should throw an error
|
||||
do_throw("Error, deleteCards should throw an error when null is passed to it");
|
||||
}
|
||||
catch (e) {
|
||||
// make sure the correct error message was thrown
|
||||
do_check_neq(e.toString().indexOf("NS_ERROR_INVALID_POINTER"), -1);
|
||||
}
|
||||
}
|
Загрузка…
Ссылка в новой задаче