From 09828cb9ab33c12c4d3176695a0a6ddedae35e4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Marseault?= <22910497+Larsluph@users.noreply.github.com> Date: Fri, 23 Jun 2023 07:53:02 +0200 Subject: [PATCH] fix: size error when deleting torrents under certain conditions (#870) --- src/store/getters.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/store/getters.ts b/src/store/getters.ts index 04e01438..7ddaa299 100644 --- a/src/store/getters.ts +++ b/src/store/getters.ts @@ -23,8 +23,9 @@ export default { getTorrentCountString: (state: StoreState, getters: any) => () => { if (state.selected_torrents.length) { let selectedSize = state.selected_torrents - .map(hash => getters.getTorrent(hash)) - .map(torrent => torrent.size | 0) + .map(getters.getTorrent) + .filter(torrent => torrent !== undefined) + .map(torrent => torrent.size) .reduce((partialSum, newVal) => partialSum + newVal) return i18n