Deal with the threat in an appropriate manner. If possible, make like roadrunner and get the hell outta there.
If your gun is in your hand, leave it there until you're sure you're out of the danger zone or the immediate need has passed.
If so, replace the gun back in its carry mode in the safest manner possible. You may be shaking and breathing hard and if so, your fine motor skills are trashed- so be extra cautious. If you need to look at the holster, gun-bag etc. then DO that. The object of having a concealed weapon is to avoid death or serious injury at the hands of an attacker. It sort of defeats the purpose if you shoot yourself.
If the cops show up while you still have a gun in your hand, expect to be treated to a roadside gun show and expedient handcuffing. You will probably not be shot so long as you don't point the gun their direction and follow instructions immediately.
“Nine-tenths of tactics are certain, and taught in books: but the irrational tenth is like the kingfisher flashing across the pool, and that is the test of generals. It can only be ensured by instinct, sharpened by thought practicing the stroke so often that at the crisis it is as natural as a reflex.” ~ T. E. Lawrence