diff --git a/lib/commands/sync.js b/lib/commands/sync.js index 9fcd516..6dbfa74 100644 --- a/lib/commands/sync.js +++ b/lib/commands/sync.js @@ -48,7 +48,7 @@ module.exports = { debug('Reading archive in dir', opts.dir) Dat(opts.dir, opts, function (err, dat) { - if (err && err.indexOf('No existing') === -1) return exit(err) + if (err && err.message && err.message.indexOf('No existing') === -1) return exit(err) else if (err || !dat.resumed) return exit('No existing archive. Please use `dat create` or `dat clone` first.') if (dat.owner) debug('Archive owner, syncing local updates to network') else debug('Not archive owner, syncing remote updates')