[LON-CAPA-cvs] cvs: loncom /homework randomlylabel.pm

matthew lon-capa-cvs@mail.lon-capa.org
Mon, 16 Dec 2002 14:41:15 -0000


matthew		Mon Dec 16 09:41:15 2002 EDT

  Modified files:              
    /loncom/homework	randomlylabel.pm 
  Log:
  Better to log an error than to bring the httpd to its knees.
  
  
Index: loncom/homework/randomlylabel.pm
diff -u loncom/homework/randomlylabel.pm:1.3 loncom/homework/randomlylabel.pm:1.4
--- loncom/homework/randomlylabel.pm:1.3	Sun Nov 17 04:43:40 2002
+++ loncom/homework/randomlylabel.pm	Mon Dec 16 09:41:15 2002
@@ -2,7 +2,7 @@
 # The LearningOnline Network with CAPA
 # randomlabel.png: composite together text and images into 1 image
 #
-# $Id: randomlylabel.pm,v 1.3 2002/11/17 09:43:40 albertel Exp $
+# $Id: randomlylabel.pm,v 1.4 2002/12/16 14:41:15 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -64,6 +64,10 @@
                &Apache::lonnet::unescape($ENV{'imagerequest.'.$token}));
     &Apache::lonnet::delenv('imagerequest\.'.$token);
     my $image=&get_image($ENV{"form.BGIMG"},0);
+    if (! defined($image)) {
+        &Apache::lonnet::logthis('Unable to create image object for '.$ENV{"form.BGIMG"});
+        return OK;
+    }
     #binmode(STDOUT);
     my $black = $image->colorAllocate(0,0,0);
     for(my $i=0;$i<$ENV{"form.ICOUNT"};$i++) {