diff options
-rw-r--r-- | lib/Torrent.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Torrent.js b/lib/Torrent.js index 6d047a0..f6a71ef 100644 --- a/lib/Torrent.js +++ b/lib/Torrent.js @@ -135,8 +135,11 @@ function Torrent (uri, opts) { chrome.fileSystem.chooseEntry({ type: 'saveFile', suggestedName: this.displayName + '.torrent' - }, function (writableFileEntry) { - writableFileEntry.createWriter(function (writer) { + }, function (fileEntry) { + if (!fileEntry) + return + + fileEntry.createWriter(function (writer) { writer.onerror = errorHandler writer.onwriteend = function (e) { console.log('write complete') |