From 081799ea65e95490062452adf49bc12c4b8d5fff Mon Sep 17 00:00:00 2001 From: Jim Norman Date: Thu, 25 May 2006 14:48:04 +0000 Subject: [PATCH] Firefox Extension: Save key/values when the length is greater than 0. --- .../common/casajar/content/casaOverlay.js | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/extensions/common/casajar/content/casaOverlay.js b/extensions/common/casajar/content/casaOverlay.js index 9ce67502..36c14311 100644 --- a/extensions/common/casajar/content/casaOverlay.js +++ b/extensions/common/casajar/content/casaOverlay.js @@ -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; + } } } }