Added an extra check on params to make sure it's an object before calling .HasMember()