And this exact scenario is outlined in the Adjudicator's Field Manual (the new Policy Manual isn't fully online yet, but this guidance still stands): https://www.uscis.gov/sites/default/files/document/policy-manual-afm/afm21-external.pdf
Review automatic revocation on p. 68:
The grounds for automatic revocation are set forth in 8 CFR 205.1(a) . Officers should be familiar with each of the events spelled out in the regulation. Under each of these grounds, the revocation is automatic when the specified events occurs, regardless of whether USCIS is aware of its occurrence or not, and regardless of when (or even whether) USCIS provides notification of the revocation. For example, if an alien who is the beneficiary of an approved 2nd preference visa petition as the unmarried son or daughter of a lawful permanent resident marries before immigrating to the United States or adjusting status, the petition’s approval is revoked. It should be noted that although it is the event of the marriage which triggers the revocation, the revocation itself is as of the date of the petition’s approval (in automatic revocation proceedings, revocation upon notice is different). Furthermore, because the petition’s approval has been revoked, it does not become valid again if the marriage of the beneficiary is terminated through divorce or death of the beneficiary’s spouse. (However, if the marriage is annulled by a court of competent authority, the legal effect is that the marriage never occurred and therefore, neither did the revocation.)