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>2015-03-01 00:56:36 +0300
committerFeross Aboukhadijeh <feross@feross.org>2015-03-01 00:56:36 +0300
commita44506e679b5c4ac7341bbb3ef277e2c092362e9 (patch)
treea4f98434c0642f4abbb4d5e10be033b4304e3d2e /index.js
parentf252d16df4a6142cb2a65d02b5014e92bb88b53c (diff)
parse-torrent@4
Diffstat (limited to 'index.js')
-rw-r--r--index.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/index.js b/index.js
index ab41bfe..4332f06 100644
--- a/index.js
+++ b/index.js
@@ -125,7 +125,7 @@ Object.defineProperty(WebTorrent.prototype, 'ratio', {
WebTorrent.prototype.get = function (torrentId) {
var self = this
var parsed = parseTorrent(torrentId)
- if (!parsed || !parsed.infoHash) return null
+ if (!parsed.infoHash) throw new Error('Invalid torrent identifier')
for (var i = 0, len = self.torrents.length; i < len; i++) {
var torrent = self.torrents[i]
if (torrent.infoHash === parsed.infoHash) return torrent