Skip to content

Commit

Permalink
Fix trackerdata check
Browse files Browse the repository at this point in the history
  • Loading branch information
phillmac committed May 21, 2021
1 parent 2780127 commit 23c9fab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/scrape-functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module.exports = function (redisClient, lock, debugVerbose = false) {
wasStale = true

const trackerResults = await scrapeTrackers(torrent._id, staleTrackers)
if (!trackerData) {
if (!torrent.trackerData) {
torrent.trackerData = trackerResults
} else {
torrent.trackerData = Object.assign(torrent.trackerData, trackerResults)
Expand Down Expand Up @@ -139,7 +139,7 @@ module.exports = function (redisClient, lock, debugVerbose = false) {

const torrent = JSON.parse(await redisClient.hgetAsync('torrents', hash))

if (!torrent._id) {
if (!torrent?._id) {
throw new Error(`Unable to find info for torrent with id ${hash}`)
}

Expand Down

0 comments on commit 23c9fab

Please sign in to comment.