mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 13:51:41 +00:00
Bug 921918 - 3.g/4: fix possible "undefined" value for messageRecord.envelopeIdIndex. r=gene
This commit is contained in:
parent
160f535c41
commit
cd6f1090ff
@ -2104,7 +2104,7 @@ MmsService.prototype = {
|
||||
|
||||
if (errorCode !== Ci.nsIMobileMessageCallback.SUCCESS_NO_ERROR) {
|
||||
if (DEBUG) debug("Error! The params for sending MMS are invalid.");
|
||||
sendTransactionCb(aDomMessage, errorCode);
|
||||
sendTransactionCb(aDomMessage, errorCode, null);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -2117,7 +2117,7 @@ MmsService.prototype = {
|
||||
} catch (e) {
|
||||
if (DEBUG) debug("Exception: fail to create a SendTransaction instance.");
|
||||
sendTransactionCb(aDomMessage,
|
||||
Ci.nsIMobileMessageCallback.INTERNAL_ERROR);
|
||||
Ci.nsIMobileMessageCallback.INTERNAL_ERROR, null);
|
||||
return;
|
||||
}
|
||||
sendTransaction.run(function callback(aMmsStatus, aMsg) {
|
||||
@ -2134,10 +2134,8 @@ MmsService.prototype = {
|
||||
} else {
|
||||
errorCode = Ci.nsIMobileMessageCallback.SUCCESS_NO_ERROR;
|
||||
}
|
||||
let envelopeId = null;
|
||||
if (aMsg) {
|
||||
envelopeId = aMsg.headers ? aMsg.headers["message-id"] : null;
|
||||
}
|
||||
let envelopeId =
|
||||
aMsg && aMsg.headers && aMsg.headers["message-id"] || null;
|
||||
sendTransactionCb(aDomMessage, errorCode, envelopeId);
|
||||
});
|
||||
});
|
||||
|
@ -1209,6 +1209,12 @@ MobileMessageDatabaseService.prototype = {
|
||||
delete messageRecord.transactionId;
|
||||
}
|
||||
|
||||
// xpconnect gives "undefined" for an unassigned argument of an interface
|
||||
// method.
|
||||
if (messageRecord.envelopeIdIndex === "undefined") {
|
||||
delete messageRecord.envelopeIdIndex;
|
||||
}
|
||||
|
||||
cursor.update(messageRecord);
|
||||
cursor.continue();
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user