--- loncom/interface/courseprefs.pm 2022/02/16 15:58:28 1.104 +++ loncom/interface/courseprefs.pm 2022/02/21 15:44:57 1.105 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set configuration settings for a course # -# $Id: courseprefs.pm,v 1.104 2022/02/16 15:58:28 raeburn Exp $ +# $Id: courseprefs.pm,v 1.105 2022/02/21 15:44:57 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -5623,9 +5623,6 @@ sub menucollections_display { sub print_linkprotection { my ($cdom,$cnum,$settings,$rowtotal,$crstype,$noedit,$context) = @_; - unless (ref($settings) eq 'HASH') { - return; - } my %linkprotection; my $count = 0; @@ -5670,7 +5667,7 @@ sub print_linkprotection { } } - if (ref($settings->{'linkprot'}) eq 'HASH') { + if ((ref($settings) eq 'HASH') && (ref($settings->{'linkprot'}) eq 'HASH')) { if (keys(%{$settings->{'linkprot'}})) { my @current = sort { $a <=> $b } keys(%{$settings->{'linkprot'}}); $next += $current[-1]; @@ -5793,7 +5790,7 @@ sub print_linkprotection { $datatable .= ''."\n". ''."\n". ''.&mt('Add').''."\n". - ''; + ''; my ($usersty,$onclickrequser,%checkedrequser); if ($ltiauth) { $usersty = 'display:none';