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