linux_demon: do not assume nonzero threads

This commit is contained in:
Ryan Fleury committed 2026-08-12 10:01:40 -07:00
1 parent baef2f07bf
commit a47be13d70
1 file changed
+1 -1
+1 -1
View File
@@ -2148,7 +2148,7 @@ dmn_ctrl_run(Arena *arena, DMN_CtrlCtx *ctx, DMN_RunCtrls *ctrls)
case PTRACE_EVENT_STOP:
{
// rjf: stop event for pending threads -> thread is created & stopped
if(thread->state == LNX_DMN_ThreadState_PendingCreation)
if(thread != 0 && thread->state == LNX_DMN_ThreadState_PendingCreation)
{
thread->state = LNX_DMN_ThreadState_Stopped;
lnx_dmn_state->threads_pending_creation -= 1;