[open-ils-commits] r8509 - trunk/Open-ILS/web/opac/skin/default/js

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Jan 28 10:30:44 EST 2008


Author: erickson
Date: 2008-01-28 10:03:32 -0500 (Mon, 28 Jan 2008)
New Revision: 8509

Modified:
   trunk/Open-ILS/web/opac/skin/default/js/rdetail.js
Log:
protecting against edge case where we run off the end of the org table before finding a place to insert the callnumber row

Modified: trunk/Open-ILS/web/opac/skin/default/js/rdetail.js
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/js/rdetail.js	2008-01-28 04:40:26 UTC (rev 8508)
+++ trunk/Open-ILS/web/opac/skin/default/js/rdetail.js	2008-01-28 15:03:32 UTC (rev 8509)
@@ -591,10 +591,13 @@
                 sib = rowNode.nextSibling;
                 o ='cp_info_'+thisOrg.id()+'_';
                 /* push the new row on as the last row for this org unit */
-                while( sib.id.match(o) ) {
+                while( sib && sib.id.match(o) ) {
                     sib = sib.nextSibling;
                 }
-				rowNode = copyRowParent.insertBefore(copyRow.cloneNode(true), sib);
+                if(sib)
+				    rowNode = copyRowParent.insertBefore(copyRow.cloneNode(true), sib);
+                else
+                    rowNode = copyRowParent.appendChild(copyRow.cloneNode(true));
             } else {
 				rowNode = copyRowParent.appendChild(copyRow.cloneNode(true));
             }



More information about the open-ils-commits mailing list