From 2a38f79ded7f040c2f8b1b9cccdfca7d970530df Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Mon, 2 May 2016 18:29:29 -0700 Subject: Handle failures to load save state from the menu more gracefully --- menu.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'menu.c') diff --git a/menu.c b/menu.c index 052ed19..6d8786e 100644 --- a/menu.c +++ b/menu.c @@ -301,6 +301,9 @@ void * menu_write_w(uint32_t address, void * context, uint16_t value) char *gstpath = alloc_concat_m(3, parts); uint32_t pc = load_gst(gen->next_context, gstpath); free(gstpath); + if (!pc) { + break; + } gen->next_context->m68k->resume_pc = get_native_address_trans(gen->next_context->m68k, pc); } m68k->should_return = 1; -- cgit v1.2.3