The Messenger of Allah ﷺ said, "Whoever performs the funeral prayer over a deceased person inside the mosque, there is no reward for him."
حدثنا حجاج ويزيد بن هارون قالا أخبرنا ابن أبي ذئب عن صالح مولى التوأمة
قال رسول الله ﷺ من صلى على جنازة في المسجد فلا شيء له