[LON-CAPA-cvs] cvs: loncom /interface lonannounce.pm

albertel lon-capa-cvs@mail.lon-capa.org
Fri, 13 Jan 2006 15:28:37 -0000


albertel		Fri Jan 13 10:28:37 2006 EDT

  Modified files:              
    /loncom/interface	lonannounce.pm 
  Log:
  - check that we got a res first
  
  
Index: loncom/interface/lonannounce.pm
diff -u loncom/interface/lonannounce.pm:1.43 loncom/interface/lonannounce.pm:1.44
--- loncom/interface/lonannounce.pm:1.43	Thu Jan 12 18:36:45 2006
+++ loncom/interface/lonannounce.pm	Fri Jan 13 10:28:36 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Announce
 #
-# $Id: lonannounce.pm,v 1.43 2006/01/12 23:36:45 albertel Exp $
+# $Id: lonannounce.pm,v 1.44 2006/01/13 15:28:36 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -108,13 +108,13 @@
 		    my $map_url=$1;
 		    if (!$can_see_hidden) {
 			my $res = $navmap->getResourceByUrl($map_url);
-			if ($res->randomout()) { next; }
+			if ($res && $res->randomout()) { next; }
 		    }
 		    $realm=&mt('Folder/Map').': '.&Apache::lonnet::gettitle($map_url);
 		} elsif ($middle) {
 		    if (!$can_see_hidden) {
 			my $res = $navmap->getBySymb($middle);
-			if ($res->randomout()) { next; }
+			if ($res && $res->randomout()) { next; }
 		    }
 		    $realm=&mt('Resource').': '.&Apache::lonnet::gettitle($middle);
 		}