Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/webtorrent/webtorrent.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFeross Aboukhadijeh <feross@feross.org>2014-02-05 10:28:54 +0400
committerFeross Aboukhadijeh <feross@feross.org>2014-02-05 10:37:39 +0400
commit1b64a10fbff65f250685bcd76f81c8597f7b7485 (patch)
treea762978d778dab16d43a37c2ee40f47ca8a681b2
parent9001420d6459c0ea647d5c4e294f63bf3b6d8f9e (diff)
no error if user cancels torrent file save
-rw-r--r--lib/Torrent.js7
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')