Check if an object is empty