(Not) Have a Leg to Stand On

What does the idiom “not have a leg to stand on” mean?

Definition: make a weak argument; be unable to justify oneself

Example: The customer accused us of cheating him, but when he realized he didn’t have a leg to stand on, he dropped the charge.