It asks you to confirm the purchase, and even tick a little box where you acknowledge that you can't use the weapon.

I cannot see how you would do it accidentally?