persistence fix

This commit is contained in:
Greg DiCristofaro 2023-09-15 12:45:20 -04:00
parent e9cd619533
commit 3cabad12e6

View File

@ -118,7 +118,12 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel {
@Override @Override
public synchronized void saveSettings() { public synchronized void saveSettings() {
ctPersistence.saveLicenseResponse(getLicenseInfo()); LicenseResponse licenseResponse = getLicenseInfo();
if (licenseResponse == null) {
this.ctPersistence.deleteLicenseResponse();
} else {
ctPersistence.saveLicenseResponse(licenseResponse);
}
} }
@Override @Override
@ -514,9 +519,9 @@ public class CTMalwareScannerOptionsPanel extends CTOptionsSubPanel {
}//GEN-LAST:event_purchaseLinkMouseClicked }//GEN-LAST:event_purchaseLinkMouseClicked
private void licenseInfoRemoveButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_licenseInfoRemoveButtonActionPerformed private void licenseInfoRemoveButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_licenseInfoRemoveButtonActionPerformed
this.ctPersistence.deleteLicenseResponse();
setLicenseDisplay(null, null); setLicenseDisplay(null, null);
setMalwareScansDisplay(null, null, null); setMalwareScansDisplay(null, null, null);
this.firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
}//GEN-LAST:event_licenseInfoRemoveButtonActionPerformed }//GEN-LAST:event_licenseInfoRemoveButtonActionPerformed
@NbBundle.Messages({ @NbBundle.Messages({