aboutsummaryrefslogtreecommitdiff
path: root/midend.c
diff options
context:
space:
mode:
authorBen Harris <bjh21@bjh21.me.uk>2023-01-07 19:06:51 +0000
committerBen Harris <bjh21@bjh21.me.uk>2023-01-15 16:24:27 +0000
commit68f9fae973e2ffb6c0b9ed1e0761d3a0768455ad (patch)
treec4cbd10627316efcd7073548d16ab37e41d07b7c /midend.c
parente5d106eb279c12d2454802421e723873e4bae6c2 (diff)
downloadpuzzles-68f9fae973e2ffb6c0b9ed1e0761d3a0768455ad.zip
puzzles-68f9fae973e2ffb6c0b9ed1e0761d3a0768455ad.tar.gz
puzzles-68f9fae973e2ffb6c0b9ed1e0761d3a0768455ad.tar.bz2
puzzles-68f9fae973e2ffb6c0b9ed1e0761d3a0768455ad.tar.xz
When loading, don't decode_ui unless we have a UI
If the save file doesn't have a UI line, it's not sensible to try to decode it.
Diffstat (limited to 'midend.c')
-rw-r--r--midend.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/midend.c b/midend.c
index 6c1a599..a14004d 100644
--- a/midend.c
+++ b/midend.c
@@ -2516,7 +2516,8 @@ static const char *midend_deserialise_internal(
}
data.ui = me->ourgame->new_ui(data.states[0].state);
- me->ourgame->decode_ui(data.ui, data.uistr);
+ if (data.uistr)
+ me->ourgame->decode_ui(data.ui, data.uistr);
/*
* Run the externally provided check function, and abort if it