Fix a NPE in case of tasks not having a type defined.