Fix: edit null pointer exception when no task is found