check if environment stat cats are undefined
authorLlewellyn Marshall <llewellyn.marshall@ncdcr.gov>
Mon, 11 Jul 2022 13:01:24 +0000 (09:01 -0400)
committerLlewellyn Marshall <llewellyn.marshall@ncdcr.gov>
Mon, 11 Jul 2022 13:01:24 +0000 (09:01 -0400)
Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js

index 9b2006a..3830fe2 100644 (file)
@@ -311,8 +311,13 @@ angular.module('egCoreMod')
             egCore.auth.token(), egCore.auth.user().ws_ou()
         ).then(function(cats) {
                        //filter out stat cats unless accessible by env
-                       cats = cats.filter(function(cat) { 
-                       egCore.env.actsc.list.find(ecat => cat.id() == ecat.id())});
+                       if(egCore.env.actsc !== undefined){
+                               cats = cats.filter(
+                                       function(cat) { 
+                                                       egCore.env.actsc.list.find(ecat => cat.id() == ecat.id())
+                                               }
+                                       );
+                       }
             cats = cats.sort(function(a, b) {
                 return a.name() < b.name() ? -1 : 1});
             angular.forEach(cats, function(cat) {