only produce poster image from valid file types

This commit is contained in:
Feross Aboukhadijeh
2016-03-03 23:37:41 -08:00
parent 75a33228e8
commit 3f60f1c7f2
2 changed files with 11 additions and 4 deletions

View File

@@ -216,7 +216,7 @@ function addTorrentEvents (torrent) {
function torrentReady (torrent) {
torrentPoster(torrent, function (err, buf) {
if (err) return onError(err)
if (err) return onWarning(err)
torrent.posterURL = URL.createObjectURL(new Blob([ buf ], { type: 'image/png' }))
update()
})