A Queens judge has thrown out a lawsuit brought by the parents of an ex-student at Christ the King HS who was booted for allegedly showing naked pics of an ex-girlfriend on his phone.

Joseph Farley was thrown out of the Catholic school this year after being ordered by Assistant Principal Carol Timpone to turn over his cellphone after the girl’s mother complained, according to the suit.

After Farley refused, he was expelled.

Judge Roger Rosengarten ruled the school was in its rights to demand Farley’s phone.