The dog for an early warning to draw the pistol.
You are 100% correct.
It usually goes like this... walking down the trail with the dog up ahead. Dog runs into bear and runs back to you, followed by angry bear.