From 1664e92ff0b9b0f572b512d44db2f9cd336b85ed Mon Sep 17 00:00:00 2001 From: erickson Date: Mon, 28 Jan 2008 15:04:43 +0000 Subject: [PATCH] protecting against edge case where we run off the end of the org table before finding a place to insert the callnumber row git-svn-id: svn://svn.open-ils.org/ILS/branches/acq-experiment@8510 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/opac/skin/default/js/rdetail.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Open-ILS/web/opac/skin/default/js/rdetail.js b/Open-ILS/web/opac/skin/default/js/rdetail.js index 76aee75813..46c405238e 100644 --- a/Open-ILS/web/opac/skin/default/js/rdetail.js +++ b/Open-ILS/web/opac/skin/default/js/rdetail.js @@ -591,10 +591,13 @@ function _rdetailBuildInfoRows(r) { 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)); } -- 2.11.0