fix possible crash in SD/MMC code

This commit is contained in:
Arisotura
2025-08-30 14:18:58 +02:00
parent 631080aa4e
commit 7ed33b4d93

View File

@ -287,8 +287,10 @@ void DSi_SDHost::SetCardIRQ()
u16 oldflags = CardIRQStatus & ~CardIRQMask;
DSi_SDDevice* dev = Ports[PortSelect & 0x1].get();
if (dev->IRQ) CardIRQStatus |= (1<<0);
else CardIRQStatus &= ~(1<<0);
if (dev && dev->IRQ)
CardIRQStatus |= (1<<0);
else
CardIRQStatus &= ~(1<<0);
u16 newflags = CardIRQStatus & ~CardIRQMask;