handle null or empty objects