Checking for NULL to prevent empty objects