1
0
forked from 0ad/0ad

Fix an edge case when you would delete the last savegame and thus, the metadata would be undefined.

Introduced in a8c6d7a82b
Thread:
https://wildfiregames.com/forum/topic/89261-a-new-series-of-bugs/#comment-514015

This was SVN commit r27053.
This commit is contained in:
Stan 2022-08-14 15:10:38 +00:00
parent daaa87b48c
commit 8c497bea0d

View File

@ -28,7 +28,7 @@ class SavegameWriter
onSelectionChange(gameID, metadata, label)
{
this.confirmButton.enabled = !!metadata || Engine.IsGameStarted();
if (!this.descriptionChanged && typeof metadata.description === "string")
if (!this.descriptionChanged && metadata && typeof metadata.description === "string")
this.saveGameDesc.caption = metadata.description;
this.confirmButton.onPress = () => {
this.saveGame(gameID, label);