Patch Uicc connector errors during shutdown
authorjlal@mozilla.com
Thu, 04 Jun 2015 20:44:51 -0700
changeset 481057 934545bdb2ea985a8b11e4b95c6166a9833fc213
parent 481049 01917b55ffb031bece02ef5c7dfb8eb33f3e38d7
child 481058 1013dd1b6d5cc79bd8186b3d21c4abb153dc4977
push id72851
push userjlal@mozilla.com
push dateFri, 05 Jun 2015 03:45:44 +0000
treeherdertry@1013dd1b6d5c [default view] [failures only]
milestone41.0a1
Patch Uicc connector errors during shutdown
README.txt
dom/secureelement/gonk/UiccConnector.js
--- a/README.txt
+++ b/README.txt
@@ -53,8 +53,9 @@ testing, may be buggy. Firefox nightlies
 >>
 >>
 >>
 >>
 >>
 >>
 >>
 >>
+>>
--- a/dom/secureelement/gonk/UiccConnector.js
+++ b/dom/secureelement/gonk/UiccConnector.js
@@ -322,17 +322,17 @@ UiccConnector.prototype = {
 
     this._SEListeners.push(listener);
     // immediately notify listener about the current state
     listener.notifySEPresenceChanged(SE.TYPE_UICC, this._isPresent);
   },
 
   unregisterListener: function(listener) {
     let idx = this._SEListeners.indexOf(listener);
-    if (idx !== -1) {
+    if (idx !== -1 && this._listeners) {
       this._listeners.splice(idx, 1);
     }
   },
 
   /**
    * nsIIccListener interface methods.
    */
   notifyStkCommand: function() {},