Bug 869961 - RILContentHelper.voiceConnectionInfo fixed to check for null context. r=hsinyi
authorJon Hylands <jhylands@mozilla.com>
Mon, 13 May 2013 10:18:19 +0800
changeset 138448 feabd8f7ae0fbd3361d0bb4a1c85322e4f007ec1
parent 138447 6380de7328874e88b380b54c9cb8f1861360cf56
child 138449 4d6289816a954b82d7031655b92df7d18a6cb8b0
push idunknown
push userunknown
push dateunknown
reviewershsinyi
bugs869961
milestone23.0a1
Bug 869961 - RILContentHelper.voiceConnectionInfo fixed to check for null context. r=hsinyi
dom/system/gonk/RILContentHelper.js
--- a/dom/system/gonk/RILContentHelper.js
+++ b/dom/system/gonk/RILContentHelper.js
@@ -412,37 +412,43 @@ RILContentHelper.prototype = {
     this.updateInfo(rilContext.iccInfo, this.rilContext.iccInfo);
     this.updateConnectionInfo(rilContext.voice, this.rilContext.voiceConnectionInfo);
     this.updateConnectionInfo(rilContext.data, this.rilContext.dataConnectionInfo);
 
     return this.rilContext;
   },
 
   get iccInfo() {
-    return this.getRilContext().iccInfo;
+    let context = this.getRilContext();
+    return context && context.iccInfo;
   },
 
   get voiceConnectionInfo() {
-    return this.getRilContext().voiceConnectionInfo;
+    let context = this.getRilContext();
+    return context && context.voiceConnectionInfo;
   },
 
   get dataConnectionInfo() {
-    return this.getRilContext().dataConnectionInfo;
+    let context = this.getRilContext();
+    return context && context.dataConnectionInfo;
   },
 
   get cardState() {
-    return this.getRilContext().cardState;
+    let context = this.getRilContext();
+    return context && context.cardState;
   },
 
   get retryCount() {
-    return this.getRilContext().retryCount;
+    let context = this.getRilContext();
+    return context && context.retryCount;
   },
 
   get networkSelectionMode() {
-    return this.getRilContext().networkSelectionMode;
+    let context = this.getRilContext();
+    return context && context.networkSelectionMode;
   },
 
   /**
    * The network that is currently trying to be selected (or "automatic").
    * This helps ensure that only one network is selected at a time.
    */
   _selectingNetwork: null,