That's why I'm hesitant to have a gun in arm's reach of my bed. It usually takes me a few moments to transition from dream to reality when woken.
Exactly why mine is in the dresser a few feet away from the bed, and I don't leave a round chambered. I want to have to think about what I am doing before I can fire a single round. It's also the reason the Mag Light is right by the gun too. I have 5 dogs and they don't bark unless something is wrong, and when something IS wrong, I know they will let me know.