diff --git a/frontend/src/Movie/MovieCollectionLabel.tsx b/frontend/src/Movie/MovieCollectionLabel.tsx index 9d0c4f0227..afafd0d5c2 100644 --- a/frontend/src/Movie/MovieCollectionLabel.tsx +++ b/frontend/src/Movie/MovieCollectionLabel.tsx @@ -4,6 +4,7 @@ import MonitorToggleButton from 'Components/MonitorToggleButton'; import { toggleCollectionMonitored } from 'Store/Actions/movieCollectionActions'; import { createCollectionSelectorForHook } from 'Store/Selectors/createCollectionSelector'; import MovieCollection from 'typings/MovieCollection'; +import translate from 'Utilities/String/translate'; import styles from './MovieCollectionLabel.css'; interface MovieCollectionLabelProps { @@ -16,7 +17,8 @@ function MovieCollectionLabel({ tmdbId }: MovieCollectionLabelProps) { monitored, title, isSaving = false, - } = useSelector(createCollectionSelectorForHook(tmdbId)) as MovieCollection; + } = useSelector(createCollectionSelectorForHook(tmdbId)) || + ({} as MovieCollection); const dispatch = useDispatch(); @@ -29,6 +31,10 @@ function MovieCollectionLabel({ tmdbId }: MovieCollectionLabelProps) { [id, dispatch] ); + if (!id) { + return translate('Unknown'); + } + return (