Bug 808220 - [SMS API] Retrieve a 'sent' message show field 'sender' as 'undefined' STRING, not undefined [r=ferjm]

This commit is contained in:
Fabrice Desré 2012-11-29 05:21:11 -08:00
Родитель dfc19006a9
Коммит e8ad7b748f
1 изменённых файлов: 12 добавлений и 0 удалений

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

@ -451,6 +451,12 @@ SmsDatabaseService.prototype = {
saveReceivedMessage: function saveReceivedMessage(sender, body, messageClass, date) {
let receiver = this.mRIL.rilContext.icc ? this.mRIL.rilContext.icc.msisdn : null;
// Workaround an xpconnect issue with undefined string objects.
// See bug 808220
if (receiver === undefined || receiver === "undefined") {
receiver = null;
}
let message = {delivery: DELIVERY_RECEIVED,
deliveryStatus: DELIVERY_STATUS_SUCCESS,
sender: sender,
@ -465,6 +471,12 @@ SmsDatabaseService.prototype = {
saveSentMessage: function saveSentMessage(receiver, body, date) {
let sender = this.mRIL.rilContext.icc ? this.mRIL.rilContext.icc.msisdn : null;
// Workaround an xpconnect issue with undefined string objects.
// See bug 808220
if (sender === undefined || sender === "undefined") {
sender = null;
}
let message = {delivery: DELIVERY_SENT,
deliveryStatus: DELIVERY_STATUS_PENDING,
sender: sender,