Fix dereferencing null pointer

This commit is contained in:
Maschell 2023-03-12 17:29:35 +01:00
parent 1d00a414d2
commit 07e2682f9b

View File

@ -286,7 +286,7 @@ void NWF_Fix() {
int state = OSDisableInterrupts(); int state = OSDisableInterrupts();
OSThread *t = *((OSThread **) 0x100567F8); OSThread *t = *((OSThread **) 0x100567F8);
while (t) { while (t) {
if (std::string_view(t->name) == "PlatformInputAppStateListenerThread") { if (t->name != nullptr && std::string_view(t->name) == "PlatformInputAppStateListenerThread") {
t->priority = 0x80; t->priority = 0x80;
OSReport("Set priority to %d for thread \"%s\" (%08X) to prevent it from running/crashing\n", t->priority, t->name, t); OSReport("Set priority to %d for thread \"%s\" (%08X) to prevent it from running/crashing\n", t->priority, t->name, t);
} }