If you've never ridden before, or if you rode many years ago and are just getting back to it, your brain is still in training.
The more you ride, and actually, the more "close shaves" you survive, the more you hone your riding attitude.
You have to find that happy place between "Wow this is a blast!!!!" and "Hey, I could die!".
If you can't get over the apprehension it will suck all the enjoyment out of the riding experience. That's something you just have to work out for yourself.....
But, think about it this way,..
What if you had been in a car? Would the truck have still missed you?