To my way of thinking, if I was a licensed gun owner and shot someone who was putting my life in danger, in all likelihood I would not be prosecuted.
You don't have to have a license to own wasp spray or a baseball bat or an iron skillet or a knife (the list can go on and on). I don't think I'd be prosecuted if I used any of those items to defend my life even though I used it for a purpose for which it was not intended.
The potential robber, killer, rapist, etc. deserves whatever he gets.