Does resigning keep you out of prison for consorting with the enemy❓

Asking for a friend,