Create error on zero-byte poster (#352)
* Error on zero-byte poster * return cb to stop execution
This commit is contained in:
committed by
Feross Aboukhadijeh
parent
457aca25ee
commit
da1e120de9
@@ -64,6 +64,8 @@ function torrentPosterFromVideo (file, torrent, cb) {
|
|||||||
|
|
||||||
server.destroy()
|
server.destroy()
|
||||||
|
|
||||||
|
if (buf.length === 0) return cb(new Error('Generated poster contains no data'))
|
||||||
|
|
||||||
cb(null, buf, '.jpg')
|
cb(null, buf, '.jpg')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user