Bug 1114461 - handle failure fetching sync migration sentinel. r=rnewman
authorMark Hammond <mhammond@skippinet.com.au>
Fri, 02 Jan 2015 17:15:21 +1100
changeset 221813 f8b05f7fa4be9d4b887254e8ed963073f22f15de
parent 221812 e7c220d7f8271ced46f8015f52567de095a96f8f
child 221814 f0c081ab585843f37faf24cd6d4f09c85bf7e398
push id28045
push usercbook@mozilla.com
push dateFri, 02 Jan 2015 12:45:08 +0000
treeherdermozilla-central@4278e53a8a47 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrnewman
bugs1114461
milestone37.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1114461 - handle failure fetching sync migration sentinel. r=rnewman
services/sync/modules/service.js
--- a/services/sync/modules/service.js
+++ b/services/sync/modules/service.js
@@ -1342,17 +1342,17 @@ Sync11Service.prototype = {
     }
     if (!this.identity.syncKeyBundle) {
       this._log.error("Can't get migration sentinel: no syncKeyBundle.");
       return Promise.resolve(null);
     }
     try {
       let collectionURL = this.storageURL + "meta/fxa_credentials";
       let cryptoWrapper = this.recordManager.get(collectionURL);
-      if (!cryptoWrapper.payload) {
+      if (!cryptoWrapper || !cryptoWrapper.payload) {
         // nothing to decrypt - .decrypt is noisy in that case, so just bail
         // now.
         return Promise.resolve(null);
       }
       // If the payload has a sentinel it means we must have put back the
       // decrypted version last time we were called.
       if (cryptoWrapper.payload.sentinel) {
         return Promise.resolve(cryptoWrapper.payload.sentinel);