You could do this with one line and use `active_thread ? active_thread->name : "NO THREAD"`.