Friend thanked me for hugging them?

My friend is going through a hard time. I suck at any form of comforting someone so I just hugged him and told him how much he means to me and how I care. Why would he thank me though? I just said no worries. But just wondering what this means?

*added note* I like this guy as more than just a friend, I'm unsure of his feelings.
Friend thanked me for hugging them?
Post Opinion