If a marriage or domestic partnership is determined to be void, an agreement that would otherwise have been a premarital agreement is enforceable only to the extent necessary to avoid an inequitable result, unless the agreement expressly provides that it shall be enforceable in the event that the marriage or domestic partnership is later determined to be void.
D.C. Code § 46-507
Uniform Law: This section is based upon § 7 of the Uniform Premarital Agreement Act.