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:
-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')