[Rt-commit] r4530 - in rt/branches/3.7-EXPERIMENTAL: .
    ruz at bestpractical.com 
    ruz at bestpractical.com
       
    Tue Feb 14 18:28:27 EST 2006
    
    
  
Author: ruz
Date: Tue Feb 14 18:28:16 2006
New Revision: 4530
Modified:
   rt/branches/3.7-EXPERIMENTAL/   (props changed)
   rt/branches/3.7-EXPERIMENTAL/lib/RT/Config.pm
Log:
 r1701 at cubic-pc:  cubic | 2006-02-15 01:37:56 +0300
 * if config option was not set (doesn't exist) then
   return empty value instead of undef. In other case
   when caller want array we return array with one ellement
   which fails checks "if ( @array )"
Modified: rt/branches/3.7-EXPERIMENTAL/lib/RT/Config.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/lib/RT/Config.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL/lib/RT/Config.pm	Tue Feb 14 18:28:16 2006
@@ -185,9 +185,10 @@
 {
     my $self = shift;
     my $name = shift;
-    my $type = $META{$name}->{'Type'} || 'SCALAR';
+    return unless exists $OPTIONS{$name};
     return $OPTIONS{$name} unless wantarray;
 
+    my $type = $META{$name}->{'Type'} || 'SCALAR';
     if( $type eq 'ARRAY' ) {
         return @{ $OPTIONS{$name} };
     } elsif( $type eq 'HASH' ) {
    
    
More information about the Rt-commit
mailing list