fix harmless warning, RT#4681: Argument "" isn't numeric in numeric eq (==) at /usr...
authorivan <ivan>
Mon, 26 Jan 2009 01:07:19 +0000 (01:07 +0000)
committerivan <ivan>
Mon, 26 Jan 2009 01:07:19 +0000 (01:07 +0000)
FS/FS/cust_pkg.pm

index 52148aa..885eef1 100644 (file)
@@ -440,7 +440,9 @@ replace methods.
 sub check {
   my $self = shift;
 
-  $self->locationnum('') if $self->locationnum == 0 || $self->locationnum == -1;
+  $self->locationnum('')
+    if defined($self->locationnum) && length($self->locationnum)
+    && ( $self->locationnum == 0 || $self->locationnum == -1 );
 
   my $error = 
     $self->ut_numbern('pkgnum')