24. Where a marriage has been declared invalid or void the claim of the parties to any damages, maintenance or other compensation shall be governed by the same rules as in the case of divorce.