From e8ad7b748fb68af98cb123e61c3fd68d09a37756 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabrice=20Desr=C3=A9?= Date: Thu, 29 Nov 2012 05:21:11 -0800 Subject: [PATCH] Bug 808220 - [SMS API] Retrieve a 'sent' message show field 'sender' as 'undefined' STRING, not undefined [r=ferjm] --- dom/sms/src/ril/SmsDatabaseService.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dom/sms/src/ril/SmsDatabaseService.js b/dom/sms/src/ril/SmsDatabaseService.js index 1f911c776041..bf3f4d01ffa3 100644 --- a/dom/sms/src/ril/SmsDatabaseService.js +++ b/dom/sms/src/ril/SmsDatabaseService.js @@ -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,