Ugh, that sucks. As a professor, I agree with the others that you should let someone in authority know what happened. That professor needs to be firmly told, at a minimum, that he/she can’t do that again. Or possibly face some other kind of repercussion.