If any state or county officer shall die having a deputy, the deputy may continue to discharge the duties of the office in the name of the deceased officer as if he had not died, until the vacancy in the office shall be filled according to law. The official bond of the deceased officer and his estate shall be a security for the faithful performance of the duties of the office by the deputy, who shall be subject to all the provisions of law applicable to his principal in his lifetime; and the personal representative of the decedent shall have like remedy against the deputy as the decedent would have if living. Where there are two judicial districts in a county and there be a deputy in each, the deputy of the first district shall discharge the duties of the office under the provisions of this section.