Thanks for the query,
There may be a possibility of infection.
Even rubbing of penis is enough to transfer infection.
Please get yourself for std
Specially Chlamydia can be the causative agent.
Let me know if you have any other doubt.
you can ask a direct question to me on this forum, following the below link.