GBA: Fix crash if no components are defined
Jeffrey Pfau jeffrey@endrift.com
Thu, 05 Mar 2015 21:43:29 -0800
1 files changed,
1 insertions(+),
1 deletions(-)
jump to
M
src/gba/gba.c
→
src/gba/gba.c
@@ -716,7 +716,7 @@ if (gba->rr) {
gba->rr->nextFrame(gba->rr); } - if (gba->cpu->components[GBA_COMPONENT_CHEAT_DEVICE]) { + if (gba->cpu->components && gba->cpu->components[GBA_COMPONENT_CHEAT_DEVICE]) { struct GBACheatDevice* device = (struct GBACheatDevice*) gba->cpu->components[GBA_COMPONENT_CHEAT_DEVICE]; size_t i; for (i = 0; i < GBACheatSetsSize(&device->cheats); ++i) {