عَنِ ابْنِ عَبَّاسٍ رَضِيَ اللَّهُ عَنْهُمَا قَالَ لَمَّا حُوِّلَتِ الْقِبْلَةُ قَالَ أُنَاسٌ يَا رَسُولَ اللَّهِ أَصْحَابُنَا الَّذِينَ مَاتُوا وَهُمْ يُصَلُّونَ إِلَى بَيْتِ الْمَقْدِسِ فَأَنْزَلَ اللَّهُ {وَمَا كَانَ اللَّهُ لِيُضِيعَ إِيمَانَكُمْ}
Sayyiduna Abdullah bin Abbas (may Allah be pleased with them both) narrates: When the Qiblah was changed, some people said: O Messenger of Allah! What will happen to our companions who used to pray facing Bayt al-Maqdis and then died in that state? Allah Almighty revealed this verse: {وَمَا کَانَ اللّٰہُ لِیُضِیْعَ اِیْمَانَکُمْ} … Allah Almighty is not one to waste your prayers.