If any state court finds that a declaration of candidacy on a nominating petition is not valid, the candidacy shall be invalidated as of the date of filing. If the invalidation creates a vacancy which continues to exist after a primary election, the vacancy may be filled as provided in §§ 12-6-56 and 12-6-57.
SDCL 12-1-31