LP#1772062: prevent copy template apply failure on null stat cats and non-null statca...
authorJeff Davis <jdavis@sitka.bclibraries.ca>
Fri, 8 Jun 2018 19:09:54 +0000 (12:09 -0700)
committerChris Sharp <csharp@georgialibraries.org>
Sat, 8 Sep 2018 13:34:46 +0000 (09:34 -0400)
Signed-off-by: Jeff Davis <jdavis@sitka.bclibraries.ca>
Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js

index 1ddae63..258a735 100644 (file)
@@ -1206,11 +1206,13 @@ function($scope , $q , $window , $routeParams , $location , $timeout , egCore ,
                         // trim out all deleted ones; the API used to
                         // do the update doesn't actually consult
                         // isdeleted for stat cat entries
-                        cp.stat_cat_entries(
-                            cp.stat_cat_entries().filter(function (e) {
-                                return !Boolean(e.isdeleted());
-                            })
-                        );
+                        if (cp.stat_cat_entries()) {
+                            cp.stat_cat_entries(
+                                cp.stat_cat_entries().filter(function (e) {
+                                    return !Boolean(e.isdeleted());
+                                })
+                            );
+                        }
    
                         cp.ischanged(1);
                     }