If you're scared of flying, this might give you comfort or make you more terrified. The truth is: Airplanes get struck by lightning all the time. In fact, the average US airliner will be hit by lightning once a year.
If that scares you, take comfort in this: Lightning has not caused an airliner crash in the USA or of a U.S. Airline plane anywhere in more than 50 years. The last time that happened was in 1962, when a PanAm Boeing 707 got hit and a spark ignited fuel vapor in a tank.
After that happened, the rules changed to prevent a spark from ever doing that. However, pilots still avoid thunderstorms because there are a lot of other dangers like wind speeds and visibility that can be dangerous. However, next time you're on a plane and it gets hit by lightning, don't worry: That won't do the plane any harm.