changeset 1015:6c54d5a5c7c0

Handle failures to load save state from the menu more gracefully
author Michael Pavone <pavone@retrodev.com>
date Mon, 02 May 2016 18:29:29 -0700
parents ef923c4b8977
children 5fb64487b6e1
files menu.c
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/menu.c	Mon May 02 18:27:07 2016 -0700
+++ b/menu.c	Mon May 02 18:29:29 2016 -0700
@@ -301,6 +301,9 @@
 				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;