From ebfc001e4cf704ba882ec06c7a4fc7dac677b9aa Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Wed, 19 Aug 2015 22:22:00 -0400 Subject: [PATCH] LP#1452950 reduce console errors on obscure dob check Avoid referencing egCore.env.* before env values have had time to arrive from the server. Signed-off-by: Bill Erickson --- Open-ILS/web/js/ui/default/staff/circ/patron/app.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/app.js b/Open-ILS/web/js/ui/default/staff/circ/patron/app.js index ff79a10a23..117d8f8516 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/patron/app.js +++ b/Open-ILS/web/js/ui/default/staff/circ/patron/app.js @@ -630,8 +630,14 @@ function($scope, $q, $location , $filter, egCore, egUser, patronSvc) { return !egCore.env.aous['circ.obscure_dob']; } - $scope.obscure_dob = function() { return egCore.env.aous['circ.obscure_dob']; } - $scope.now_show_dob = function() { return egCore.env.aous['circ.obscure_dob'] ? $scope.show_dob() : true; } + $scope.obscure_dob = function() { + return egCore.env.aous && egCore.env.aous['circ.obscure_dob']; + } + $scope.now_show_dob = function() { + return egCore.env.aous && egCore.env.aous['circ.obscure_dob'] ? + $scope.show_dob() : true; + } + $scope.patron = function() { return patronSvc.current } $scope.patron_stats = function() { return patronSvc.patron_stats } $scope.summary_stat_cats = function() { return patronSvc.summary_stat_cats } -- 2.11.0