All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger.
A person who is invited to a banquet or a similar function is not permitted to attend it if he knows that it involves prohibited acts. Also, unless he is able to forbid the evil, he is obliged to leave it once he sees any prohibited acts, if he accepted the invitation without knowing about this.
There is a beautiful Hadeeth (narration) whose chain of narration was categorized as Hasan (good), which mentions that a man came to ‘Ali as a guest. ‘Ali prepared food for him, then he invited the Prophet, sallallaahu ‘alayhi wa sallam, to eat with them. When he, sallallaahu ‘alayhi wa sallam, arrived, he put his hand on the two sides of the door, and upon seeing a piece of colorful and embellished cloth, he refused to enter. When ‘Ali followed him and asked about the reason for this, he stated that prophets do not enter decorated houses. [Abu Daawood]
Abu At-Tayyib Al-‘Atheem Aabaadi quoted Ibn Hajar as stating that it could be deduced from this Hadeeth that the presence of evil in a house prevents a person from entering it. Ibn Battaal mentioned that it is not permissible to attend a banquet which features an evil that Allaah The Almighty and his Messenger prohibited. This is because it implies that the person is contented with it. He set the opinions of the early scholars on the issue. In brief, there would be no harm if the person finds an evil there and forbids it, in case he is able to. Otherwise, he should leave.
Allaah Knows best.