diff --git a/sched/sched/sched_gettcb.c b/sched/sched/sched_gettcb.c index 776927dd4a8..373e21828fa 100644 --- a/sched/sched/sched_gettcb.c +++ b/sched/sched/sched_gettcb.c @@ -76,7 +76,7 @@ FAR struct tcb_s *nxsched_get_tcb(pid_t pid) /* Verify that the correct TCB was found. */ - if (pid == g_pidhash[hash_ndx].pid) + if (g_pidhash && pid == g_pidhash[hash_ndx].pid) { /* Return the TCB associated with this pid (if any) */