2539. Where the policy is null or is cancelled by the insurer before the commencement of the risk, the premium is returnable provided there has been no fraud or illegality on the part of the insured; but if the risk is not apportionable, and has once attached, the premium is not returnable.