GBA: Fix crash if no components are defined

This commit is contained in:
Jeffrey Pfau 2015-03-05 21:43:29 -08:00
parent 6835ac8a81
commit 2a6ff14a3b
1 changed files with 1 additions and 1 deletions

View File

@ -716,7 +716,7 @@ void GBAFrameEnded(struct GBA* gba) {
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) {