From c9b307c6e9902c92e5a15011f43a7889c1910831 Mon Sep 17 00:00:00 2001 From: Sebastian Helzle Date: Fri, 4 Aug 2023 16:24:46 +0200 Subject: [PATCH] BUGFIX: Prevent rare loading error in inspector --- .../components/SideBarRight/Inspector/PropertyInspector.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Resources/Private/JavaScript/media-module/src/components/SideBarRight/Inspector/PropertyInspector.tsx b/Resources/Private/JavaScript/media-module/src/components/SideBarRight/Inspector/PropertyInspector.tsx index 979c97b62..959cabbac 100644 --- a/Resources/Private/JavaScript/media-module/src/components/SideBarRight/Inspector/PropertyInspector.tsx +++ b/Resources/Private/JavaScript/media-module/src/components/SideBarRight/Inspector/PropertyInspector.tsx @@ -42,7 +42,9 @@ const PropertyInspector = () => { caption !== selectedAsset.caption || copyrightNotice !== selectedAsset.copyrightNotice); - const assetSourceForSelectedAsset = assetSources.find(({ id }) => id === selectedAsset.assetSource.id); + const assetSourceForSelectedAsset = selectedAsset + ? assetSources.find(({ id }) => id === selectedAsset.assetSource.id) + : null; const handleDiscard = useCallback(() => { if (selectedAsset) {