LP1803584 Avoid JS errors when clearing copy templates
authorBill Erickson <berickxx@gmail.com>
Fri, 8 Mar 2019 17:09:07 +0000 (12:09 -0500)
committerDan Pearl <dpearl@cwmars.org>
Fri, 24 May 2019 18:52:08 +0000 (14:52 -0400)
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 <berickxx@gmail.com>
Signed-off-by: Dan Pearl <dpearl@cwmars.org>
Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js

index a9c28c9..287524c 100644 (file)
@@ -1200,7 +1200,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;
             }
         }