fix: ensure objectId exists before removing game from favorites

This commit is contained in:
Hachi-R 2025-02-16 17:05:55 -03:00
parent 21684ef6b1
commit b74e093ddf

View file

@ -61,9 +61,9 @@ export function HeroPanelActions() {
setToggleLibraryGameDisabled(true);
try {
if (game?.favorite) {
if (game?.favorite && objectId) {
await window.electron
.removeGameFromFavorites(shop, objectId!)
.removeGameFromFavorites(shop, objectId)
.then(() => {
showSuccessToast(t("game_removed_from_favorites"));
});