It's not a (legislated) law, it is case law; i.e. the question was brought before a judge because there was no existing law, and the judge decided that the existing law should be interpreted to include that proscription. The decision can be overturned by a higher court.