LP#1772062: prevent copy template apply failure on null stat cats and non-null statca... user/jeffdavis/lp1772062-copy-templates-null-stat-cats
authorJeff Davis <jdavis@sitka.bclibraries.ca>
Fri, 8 Jun 2018 19:09:54 +0000 (12:09 -0700)
committerJeff Davis <jdavis@sitka.bclibraries.ca>
Tue, 19 Jun 2018 21:31:13 +0000 (14:31 -0700)
Signed-off-by: Jeff Davis <jdavis@sitka.bclibraries.ca>
Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js

index a744a0c..4bb3f19 100644 (file)
@@ -1218,11 +1218,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);
                     }