Most Helpful Guy
It is your mind telling you not to panic because those that love you will stay by your side no matter what.
Your emotional turmoil from the breakup means that those feelings are prevalent at the moment so the mind has used this imprint as the screenplay for it's REM test runs.
While you sleep the body repairs itself and prepares itself for stressful events. It can only do this through the 5 senses of the body. Thus it is using the imprinted stimuli to run 'simulations'. If you spent a lot of time sleeping in the same bed as your ex, that will be why the mind is using his image to tell you you won't be alone in times of crisis.
Think of this dream as nonsensical as dreams that have no relation to real life at all. It's just a simulation designed to ensure the body can cope through it's own stress responses and external stimuli.