وَقَدْ نَزَّلَ عَلَيْكُمْ فِي الْكِتَابِ أَنْ إِذَا سَمِعْتُمْ آيَاتِ اللّهِ يُكَفَرُ بِهَا وَيُسْتَهْزَأُ بِهَا فَلاَ تَقْعُدُواْ مَعَهُمْ حَتَّى يَخُوضُواْ فِي حَدِيثٍ غَيْرِهِ إِنَّكُمْ إِذًا مِّثْلُهُمْ إِنَّ اللّهَ جَامِعُ الْمُنَافِقِينَ وَالْكَافِرِينَ فِي جَهَنَّمَ جَمِيعًا
﴿١٤٠﴾
سورة النساء
(4/140) And indeed He has sent down to you in the Book (the Qur'ân) that when you hear Allah’s Verses disbelieved (denied, rejected) in and mocked at, do not sit with them until they engage in some other discourse; surely then you would be like them (if you sit with them); surely Allah is the One who will gather together the hypocrites and the disbelievers all in Hell.
Surah An-Nisa