utils: consider the case that an entry is null