tasking: Check for null pointer first

This commit is contained in:
EnderIce2
2024-11-19 04:33:47 +02:00
parent 3709683af8
commit 4d192732cc
3 changed files with 20 additions and 1 deletions

View File

@@ -111,7 +111,10 @@ void KernelMainThread()
initProc = TaskManager->GetProcessByID(tid);
initThread = TaskManager->GetThreadByID(tid, initProc);
TaskManager->WaitForThread(initThread);
ExitCode = initThread->GetExitCode();
if (initThread)
ExitCode = initThread->GetExitCode();
else
ExitCode = 0xEBAD;
Exit:
KPrint("\x1b[31mUserspace process exited with code %d (%#x)",
ExitCode, ExitCode < 0 ? -ExitCode : ExitCode);