diff options
author | Michael Pavone <pavone@retrodev.com> | 2016-12-27 18:58:31 -0800 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2016-12-27 18:58:31 -0800 |
commit | e2e00fe60bcc9ff0e8f76cf3f9e4ef17113b4519 (patch) | |
tree | 03c562b569ae471a47f2319579dc25ced61be211 /blastem.c | |
parent | 2abec47c2a2598da7cf6c2fdeffcfb6a6277f373 (diff) |
Detect failures to initialize a system context and report an error rather than crashing
Diffstat (limited to 'blastem.c')
-rw-r--r-- | blastem.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -339,6 +339,9 @@ int main(int argc, char ** argv) rom_info info; current_system = alloc_config_system(stype, cart, rom_size, lock_on, lock_on_size, menu ? 0 : opts, force_region, &info); + if (!current_system) { + fatal_error("Failed to detect system type for %s\n", romfname); + } setup_saves(romfname, &info, current_system); update_title(info.name); if (menu) { @@ -371,6 +374,9 @@ int main(int argc, char ** argv) } //allocate new genesis context game_context = alloc_config_system(stype, cart, rom_size, lock_on, lock_on_size, opts,force_region, &info); + if (!game_context) { + fatal_error("Failed to detect system type for %s\n", menu_context->next_rom); + } menu_context->next_context = game_context; game_context->next_context = menu_context; setup_saves(menu_context->next_rom, &info, game_context); |