Checking for empty object in set()