fix crash when files is not loaded in torrent

This commit is contained in:
YouROK
2020-12-25 16:18:17 +03:00
parent ab779f9668
commit ad8775d18d
4 changed files with 5 additions and 3 deletions

View File

@@ -84,6 +84,8 @@ export default function DialogTorrentInfo(props) {
}
function getPlayableFile(torrent){
if (!torrent || !torrent.file_stats)
return null
return torrent.file_stats.filter(file => extPlayable.includes(getExt(file.path)))
}