Officer lucky the perp was a bad shot. Officer dove off the motorcycle to safety (distance), re-oriented, returned fire, downed perp. Good job, good outcome.
Wait, this happened in Commiefornia? They don't allow guns there. The perp could not have shot at the officer. I call fake news. And officer is racist. Problem solved.