From: Bill Erickson Date: Fri, 8 Mar 2019 17:09:07 +0000 (-0500) Subject: LP1803584 Avoid JS errors when clearing copy templates X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=refs%2Fheads%2Fuser%2Fberick%2Flp1803584-copy-edit-template-clear;p=working%2FEvergreen.git LP1803584 Avoid JS errors when clearing copy templates Minor fix to sanity check multi-copy data in the copy template editor after clearing the template contents. This cleans up some ugly console errors. Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js b/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js index f39f445c6c..5295be38c4 100644 --- a/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js +++ b/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js @@ -1179,7 +1179,8 @@ function($scope , $q , $window , $routeParams , $location , $timeout , egCore , var keys = Object.keys($scope.working.MultiMap); // for-loop for shortcut exit for (var i = 0; i < keys.length; i++) { - if ($scope.working.MultiMap[keys[i]].length > 1) { + if ($scope.working.MultiMap[keys[i]] && + $scope.working.MultiMap[keys[i]].length > 1) { return true; } }