Firefox Extension: Save key/values when the length is greater than 0.

This commit is contained in:
Jim Norman 2006-05-25 14:48:04 +00:00
parent b429401790
commit 081799ea65

View File

@ -234,8 +234,7 @@ function promptuser()
obj = Components.classes[cid].createInstance(); obj = Components.classes[cid].createInstance();
obj = obj.QueryInterface(Components.interfaces.IMiCASAKeys); obj = obj.QueryInterface(Components.interfaces.IMiCASAKeys);
} }
//alert("Reading");
var theValue = new String; var theValue = new String;
var res; var res;
try try
@ -383,20 +382,23 @@ function promptuser()
{ {
//alert('do nothing'); //alert('do nothing');
} }
else else
{ {
logMessage('Writing ' + secretID + ' : ' + sKey + ' : xxxxxxx'); if (sValue.length > 0)
try { {
res = obj.miCASAWriteKey(secretID, sKey, sValue); logMessage('Writing ' + secretID + ' : ' + sKey + ' : xxxxxxx');
if (res != 0) try {
logMessage('Error saving key'); res = obj.miCASAWriteKey(secretID, sKey, sValue);
} if (res != 0)
catch (err) logMessage('Error saving key');
{ }
alert('CASA services not available'); catch (err)
logMessage(err); {
window.close(); alert('CASA services not available');
return; logMessage(err);
window.close();
return;
}
} }
} }
} }