There is also a saying that married women dream of having an affair because they are easy virtue and bohemian.
To sum up, all dreams are collages of real life, which are all caused by the subconscious mind. This kind of dream may appear because you love your family or lover very much and are afraid that an affair will destroy the harmony of your family. It may also be that you have encountered such a thing in real life, so you need to increase communication with each other in your later life, so as to uncover the confusion in the dreamer's heart.