وَمَا كَانَ رَبُّكَ لِيُهْلِكَ ٱلْقُرَىٰ بِظُلْمٍۢ وَأَهْلُهَا مُصْلِحُونَ
Surah Hud
Tafsir 11:117
Your Lord, O Messenger, would not destroy any town if its inhabitants were acting correctly on earth. He would only destroy it if the inhabitants were causing corruption by disbelief, disobedience and sins.