Whenever the Messenger of Allah ﷺ heard the sound of thunder and thunderbolts, he would say, "O Allah, do not slay us with Your wrath, do not destroy us with Your punishment, and grant us well-being before that."
حدثنا قتيبة حدثنا عبد الواحد بن زياد عن حجاج بن أرطاة عن أبي مطر
أن رسول الله ﷺ كان إذا سمع صوت الرعد والصواعق قال اللهم لا تقتلنا بغضبك ولا تهلكنا بعذابك وعافنا قبل ذلك
[Its chain is daif]. Nasai also narrated it in Amal al-Yawm wal-Layla, no. 928, from Qutayba, with the same chain.Hajjaj bin Artah is daif and known to conceal defects in his transmission, yet Hakim graded it sahih in 4/286, and Dhahabi agreed with him.