[open-ils-commits] r12167 - trunk/Open-ILS/web/js/dojo/openils/widget (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Feb 12 17:37:10 EST 2009


Author: erickson
Date: 2009-02-12 17:37:01 -0500 (Thu, 12 Feb 2009)
New Revision: 12167

Modified:
   trunk/Open-ILS/web/js/dojo/openils/widget/FilteringTreeSelect.js
Log:
no need for a store if there is no tree data (don't attempt to access dataList[0])

Modified: trunk/Open-ILS/web/js/dojo/openils/widget/FilteringTreeSelect.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/openils/widget/FilteringTreeSelect.js	2009-02-12 22:22:22 UTC (rev 12166)
+++ trunk/Open-ILS/web/js/dojo/openils/widget/FilteringTreeSelect.js	2009-02-12 22:37:01 UTC (rev 12167)
@@ -37,8 +37,10 @@
                 this.dataList = [];
                 var self = this;
                 dojo.forEach(this.tree, function(node) { self._makeNodeList(node); });
-                this.store = new dojo.data.ItemFileReadStore(
-                    {data:fieldmapper[this.dataList[0].classname].toStoreData(this.dataList)});
+                if(this.dataList.length > 0) {
+                    this.store = new dojo.data.ItemFileReadStore(
+                        {data:fieldmapper[this.dataList[0].classname].toStoreData(this.dataList)});
+                }
                 this.inherited(arguments);
             },
 



More information about the open-ils-commits mailing list