That’s ridiculous:
Someone is advancing on you and won’t back down. As soon as they see your gun, they will probably turn and run away.
The unfired gun may have saved your life and that of the would be attacker.
So they throw you in jail for not killing him?
Yes, it’s ridiculous. It’s also how the law works in many anti-freedom states (I’m in the People’s Republic of Maryland). Someone is advancing on you and wont back down. As soon as they see your gun, they should also see Jesus. The fired gun did save your life, and a still-resentful attacker (or political prosecutor) cannot claim otherwise to get revenge.