diff --git a/arch/xtensa/src/esp32/esp32_wifi_adapter.c b/arch/xtensa/src/esp32/esp32_wifi_adapter.c index c7e9860a68..44b014c8d2 100644 --- a/arch/xtensa/src/esp32/esp32_wifi_adapter.c +++ b/arch/xtensa/src/esp32/esp32_wifi_adapter.c @@ -1802,8 +1802,10 @@ static int32_t esp_task_create_pinned_to_core(void *entry, (char * const *)param); if (pid > 0) { - *((int *)task_handle) = pid; - + if (task_handle != NULL) + { + *((int *)task_handle) = pid; + } #ifdef CONFIG_SMP if (core_id < CONFIG_SMP_NCPUS) {