--- loncom/lonnet/perl/lonnet.pm 2020/10/15 18:09:10 1.1428 +++ loncom/lonnet/perl/lonnet.pm 2020/10/15 19:17:40 1.1429 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.1428 2020/10/15 18:09:10 raeburn Exp $ +# $Id: lonnet.pm,v 1.1429 2020/10/15 19:17:40 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -8767,16 +8767,18 @@ sub get_commblock_resources { my $first = $mapres->map_start(); my $finish = $mapres->map_finish(); my $it = $navmap->getIterator($first,$finish,undef,0,0); - my $res; - while ($res = $it->next(undef,1)) { - next unless (ref($res)); - my $symb = $res->symb(); - next if (($symb eq $mapsymb) || ($symb eq '')); - @interval=&EXT("resource.0.interval",$symb); - if ($interval[1] eq 'map') { - if ($res->answerable()) { - push(@to_test,$res); - last; + if (ref($it)) { + my $res; + while ($res = $it->next(undef,1)) { + next unless (ref($res)); + my $symb = $res->symb(); + next if (($symb eq $mapsymb) || ($symb eq '')); + @interval=&EXT("resource.0.interval",$symb); + if ($interval[1] eq 'map') { + if ($res->answerable()) { + push(@to_test,$res); + last; + } } } }