fix: prevent adding game to favorites without objectId

This commit is contained in:
Hachi-R 2025-02-16 17:07:39 -03:00
parent b74e093ddf
commit a372afc92c

View file

@ -68,7 +68,9 @@ export function HeroPanelActions() {
showSuccessToast(t("game_removed_from_favorites")); showSuccessToast(t("game_removed_from_favorites"));
}); });
} else { } else {
await window.electron.addGameToFavorites(shop, objectId!).then(() => { if (!objectId) return;
await window.electron.addGameToFavorites(shop, objectId).then(() => {
showSuccessToast(t("game_added_to_favorites")); showSuccessToast(t("game_added_to_favorites"));
}); });
} }