Mishkat al-Masabih 1102
وَعَنِ ابْنِ عُمَرَ قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: «أَقِيمُوا الصُّفُوفَ وَحَاذُوا بَين المنكاكب وَسُدُّوا الْخَلَلَ وَلِينُوا بِأَيْدِي إِخْوَانِكُمْ وَلَا تَذَرُوا فرجات للشَّيْطَان وَمَنْ وَصَلَ صَفًّا وَصَلَهُ اللَّهُ وَمَنْ قَطَعَهُ قطعه الله» . رَوَاهُ أَبُو دَاوُد وَالنَّسَائِيّ مِنْهُ قَوْلَهُ: «وَمَنْ وَصَلَ صَفًّا» . إِلَى آخِرِهِ
From Ibn ʿUmar, who said: The Messenger of Allah ﷺ said: "Set the rows straight, line up the shoulders, close the gaps, be gentle with the hands of your brothers, and do not leave openings for Shaytan. Whoever joins a row, Allah joins him, and whoever cuts it, Allah cuts him off." Reported by Abu Dawud; an-Nasaʾi reported from it his words "Whoever joins a row" to the end.