Fix null pointer in getList