ספר המדות Improper Thoughts / Part II · ח
Sefer HaMiddot 800
ח. כְּשֶׁבָּאִין לְאָדָם הִרְהוּרֵי עֲבוֹדָה זָרָה, יֵדַע שֶׁיָּבוֹא לִידֵי אֵיזֶהוּ חוֹלַאַת אוֹ לִידֵי אֵיזֶהוּ עֲלִילָה מֵהַשָּׂר.
8. When thoughts of idol worship come to a person, he should know that he will come to some illness or some accusation from a governing official.