When he asks you whether you have a boyfriend while making conversation with you about relationships in general, his intentions aren’t what you are hoping for.
In this scenario, you were talking to each other about relationships.
These relationships were about friends, family, coworkers, and so on.
As a result, he naturally asks you whether you have a boyfriend given that the conversation is about relationships in general.
It’s the next logical place to go in the conversation.
In order to avoid screwing this up, continue building yourself as a person by maintaining your hobbies and starting new ones.
Indulge in new activities that challenge you mentally and physically.
This keeps you focused and grounded on yourself.
A major reason why you tend to get too attached or scared once you start dating someone or get into a relationship with them is because your level of focus changes.