diff --git a/src/renderer/src/pages/game-details/hero/hero-panel-actions.tsx b/src/renderer/src/pages/game-details/hero/hero-panel-actions.tsx index eee40df8..1ba24705 100644 --- a/src/renderer/src/pages/game-details/hero/hero-panel-actions.tsx +++ b/src/renderer/src/pages/game-details/hero/hero-panel-actions.tsx @@ -68,7 +68,9 @@ export function HeroPanelActions() { showSuccessToast(t("game_removed_from_favorites")); }); } else { - await window.electron.addGameToFavorites(shop, objectId!).then(() => { + if (!objectId) return; + + await window.electron.addGameToFavorites(shop, objectId).then(() => { showSuccessToast(t("game_added_to_favorites")); }); }