It is contemptible behavior on their part at the very least. What you can't afford to do though is loose focus on getting over this hiccup and pushing forward. Take proper advice but don't let it be the end of the world. Been there and done it, yes it sucks at the time but keep going and soon you will be able to sit back in a new job and think to yourself its all their loss.