Removed the redundant check in fromObject