She's human, and you made her feel safe enough to express that. Good on both of you.
Some years ago I was diagnosed with a potential life limiting illness. I'd seen a particular registrar to get some results and to be sent for some tests. We seemed to get on well, given the circumstances.
The last time I saw her, she told me they thought I could have an operation with a view to a cure. But I needed one more test. The results would be given to me at a certain date. I commented that this was the day after my Mums birthday, and the day before mine. She said that in that case, she thought we would be lucky.
As ever, she asked how I felt. I said that under the circumstances, it was the best news I could imagine.
As I got up to go, she came over and have me a hug, which I can still feel 25 years later.
Sometimes a hug is all we need to give it to get.
Just take the hug for what it was, an expression of the teachers humanity.