From: erickson Date: Thu, 12 Feb 2009 22:37:01 +0000 (+0000) Subject: no need for a store if there is no tree data (don't attempt to access dataList[0]) X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=d16f673e7d4443cede419b39dc4fb8eddeb75ddc;p=Evergreen.git no need for a store if there is no tree data (don't attempt to access dataList[0]) git-svn-id: svn://svn.open-ils.org/ILS/trunk@12167 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/web/js/dojo/openils/widget/FilteringTreeSelect.js b/Open-ILS/web/js/dojo/openils/widget/FilteringTreeSelect.js index 3bbe94dbc2..7adc6510a4 100644 --- a/Open-ILS/web/js/dojo/openils/widget/FilteringTreeSelect.js +++ b/Open-ILS/web/js/dojo/openils/widget/FilteringTreeSelect.js @@ -37,8 +37,10 @@ if(!dojo._hasResource["openils.widget.FilteringTreeSelect"]){ 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); },