warnings: uninitialized in eq
authorSven Schöling <s.schoeling@linet-services.de>
Tue, 27 May 2014 15:43:33 +0000 (17:43 +0200)
committerSven Schöling <s.schoeling@linet-services.de>
Tue, 27 May 2014 15:43:33 +0000 (17:43 +0200)
SL/DB/Customer.pm
SL/DB/Vendor.pm

index 36bddc0..a19520e 100644 (file)
@@ -35,7 +35,7 @@ __PACKAGE__->before_save('_before_save_set_customernumber');
 sub _before_save_set_customernumber {
   my ($self) = @_;
 
-  $self->create_trans_number if $self->customernumber eq '';
+  $self->create_trans_number if !defined $self->customernumber || $self->customernumber eq '';
   return 1;
 }
 
index 8a1ea46..9a36afb 100644 (file)
@@ -35,7 +35,7 @@ __PACKAGE__->before_save('_before_save_set_vendornumber');
 sub _before_save_set_vendornumber {
   my ($self) = @_;
 
-  $self->create_trans_number if $self->vendornumber eq '';
+  $self->create_trans_number if !defined $self->vendornumber || $self->vendornumber eq '';
   return 1;
 }