Skip to content
This repository has been archived by the owner on Apr 13, 2018. It is now read-only.

Commit

Permalink
Ensure that torrent['announce-list'] is an Array
Browse files Browse the repository at this point in the history
Replaces #18
  • Loading branch information
feross committed Apr 13, 2018
1 parent 45df955 commit 9bcffa6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function decodeTorrentFile (torrent) {

// announce and announce-list will be missing if metadata fetched via ut_metadata
result.announce = []
if (torrent['announce-list'] && torrent['announce-list'].length) {
if (Array.isArray(torrent['announce-list']) && torrent['announce-list'].length > 0) {
torrent['announce-list'].forEach(function (urls) {
urls.forEach(function (url) {
result.announce.push(url.toString())
Expand Down

0 comments on commit 9bcffa6

Please sign in to comment.