Dreaming of my ex

For some reason the past couple of night I've been having night terrors and my ex is always there and I feel so safe. I've been with my new boyfriend for almost 3 years now and love him more than anything. Why am I dreaming and thinking of my ex? I was never "in love ,in love with him" we dated my junior year of high school. But it was the one thing in my terrifying dream that made me feel super crazy safe. Why?? I feel like I'm cheating on my boyfriend in my dreams!