Are you sure about that? Targets are declared before range is determined, for ranged attacks, at least. Maybe for melee (can't remember if you can always check your melee range during activation, or if that's just Warmachine) they'd both have to be in range.
Being out of range doesn't mean it isn't a legal target, just that you're going to miss.
That said, the wording doesn't say "you have to target the nightmare" it says, "you may not target the Dreamer."
I may be wrong, but that's how I read it.