Print meta information only if present
authorAnant Narayanan <anant@kix.in>
Mon, 02 Mar 2009 19:25:50 +0100
changeset 45307 2d2fe67a444270186589b535fce06e14ff38febc
parent 45306 e364127c5e1c6b1171041101348cea8ffbdd264e
child 45308 42a55d7876d90e29387da4d8dcc8a730e530ea90
child 45309 deadcea07a9ca774a7626092cd2c1eb8e0a93628
push idunknown
push userunknown
push dateunknown
Print meta information only if present
services/sync/modules/service.js
--- a/services/sync/modules/service.js
+++ b/services/sync/modules/service.js
@@ -571,17 +571,22 @@ WeaveSvc.prototype = {
     let ret = false; // false to abort sync
     let reset = false;
 
     this._log.debug("Fetching global metadata record");
     let meta = yield Records.import(self.cb, this.clusterURL +
 				    this.username + "/meta/global");
     
     this._log.debug("Min server storage version is " + MIN_SERVER_STORAGE_VERSION);
-    this._log.debug("payload storage version is " + meta.payload.storageVersion);
+    
+    if (meta) {
+          this._log.debug("payload storage version is " + 
+                          meta.payload.storageVersion);
+    }
+    
     if (!meta || !meta.payload.storageVersion || !meta.payload.syncID ||
         Svc.Version.compare(MIN_SERVER_STORAGE_VERSION,
                             meta.payload.storageVersion) > 0) {
       // abort the server wipe if the GET status was anything other than 404 or 200
       let status = Records.lastResource.lastChannel.responseStatus;
       if (status != 200 && status != 404) {
 	this._log.warn("Unknown error while downloading metadata record.  " +
 			"Aborting sync.");