Ghosts

So, I had a dream a few weeks back and a friend of mine that I hadn’t seen nor talked to in years was in it. I remember us talking to each other and laughing, just catching up. A few days after the dream I found out that he had died. Was he visiting me in my dream?