The only way to stop a bad guy sleeping with a gun, is with a good guy sleeping with a gun.
A Minnesota man fell asleep with a gun and shot himself in the leg. https://bringmethenews.com/minnesota-news/minnesota-man-accidentally-shoots-himself-while-sleeping-with-gun