[LON-CAPA-cvs] cvs: loncom /lonnet/perl lonnet.pm

raeburn lon-capa-cvs-allow@mail.lon-capa.org
Tue, 22 Jan 2008 23:12:04 -0000


raeburn		Tue Jan 22 18:12:04 2008 EDT

  Modified files:              
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  - Need to check that get_reply() was actually passed an ARRAY ref, otherwise an ISE will be generated.  Under some circumstances (e.g., a con_lost error when retrieving data from resourcedata.db) via &get_courseresdata() or &get_userresdata()), a scalar can be passed to &get_reply() from within lonnet::EXT().
  
  
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.939 loncom/lonnet/perl/lonnet.pm:1.940
--- loncom/lonnet/perl/lonnet.pm:1.939	Mon Jan 21 15:21:28 2008
+++ loncom/lonnet/perl/lonnet.pm	Tue Jan 22 18:12:02 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.939 2008/01/21 20:21:28 raeburn Exp $
+# $Id: lonnet.pm,v 1.940 2008/01/22 23:12:02 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -6751,10 +6751,14 @@
 
 sub get_reply {
     my ($reply_value) = @_;
-    if (wantarray) {
-	return @$reply_value;
+    if (ref($reply_value) eq 'ARRAY') {
+        if (wantarray) {
+	    return @$reply_value;
+        }
+        return $reply_value->[0];
+    } else {
+        return $reply_value;
     }
-    return $reply_value->[0];
 }
 
 sub check_group_parms {