don't bomb out on this transition on old databases without history records for everyt...
authorivan <ivan>
Fri, 22 Feb 2008 00:57:38 +0000 (00:57 +0000)
committerivan <ivan>
Fri, 22 Feb 2008 00:57:38 +0000 (00:57 +0000)
FS/FS/cust_pay.pm

index 67f34c3..5ba5b0a 100644 (file)
@@ -698,7 +698,11 @@ sub _upgrade_data {  #class method
     return unless $cust_pay;
 
     my $h_cust_pay = $cust_pay->h_search('insert');
-    $cust_pay->otaker($h_cust_pay->history_user);
+    if ( $h_cust_pay ) {
+      $cust_pay->otaker($h_cust_pay->history_user);
+    } else {
+      $cust_pay->otaker('legacy');
+    }
     my $error = $cust_pay->replace;
     die $error if $error;