guard against NPE when accessing map