mirror of https://github.com/mgba-emu/mgba.git
GBA: Fix crash if no components are defined
This commit is contained in:
parent
6835ac8a81
commit
2a6ff14a3b
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue