In Catholic canon law, there are a number of requirements for a valid Catholic marriage.
If the impediment is removed, or a dispensation granted, and if consent perdures, the marriage can be convalidated.