# HG changeset patch # User Martin Taal # Date 1295995738 -3600 # Node ID 67117d6c25f30692f22c3e033df3effc0c383fba # Parent 72003d0cf144787ed538c7ef6f864acb1be231d9 Made recent utilities a bit more robust diff -r 72003d0cf144 -r 67117d6c25f3 modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-recent-utilities.js --- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-recent-utilities.js Tue Jan 25 23:48:36 2011 +0100 +++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-recent-utilities.js Tue Jan 25 23:48:58 2011 +0100 @@ -84,9 +84,14 @@ // // Parameters: // * {{{propertyName}}}: the name under which the recent value is stored. - // * {{{choiceObject}}}: the object defining the last user choice. + // * {{{choiceObject}}}: the object defining the last user choice, can be null + // in this case the call returns without changing things. // addRecent: function(/* String */propertyName, /* Object */ choiceObject){ + // in some cases the choiceobject is not set, just ignore those + if (!choiceObject) { + return; + } var currentRecentValue = this.getRecentValue(propertyName); var currentIndex = -1; for (var i = 0; i < currentRecentValue.length; i++) {