fix error on changing customer when there isn't an implicit contact, RT#76405
authorIvan Kohler <ivan@freeside.biz>
Wed, 14 Jun 2017 18:00:20 +0000 (11:00 -0700)
committerIvan Kohler <ivan@freeside.biz>
Wed, 14 Jun 2017 18:00:20 +0000 (11:00 -0700)
FS/FS/cust_main.pm

index 23d54b6..f8157c4 100644 (file)
@@ -1523,8 +1523,10 @@ sub replace {
                                  custnum     => $self->custnum,
                                }
       );
-    $implicit_contact->set($_, $i_cust_contact->$_)
-      foreach qw( classnum selfservice_access comment );
+    if ( $i_cust_contact ) {
+      $implicit_contact->set($_, $i_cust_contact->$_)
+        foreach qw( classnum selfservice_access comment );
+    }
 
     my $error;
     if ( $implicit_contact->contactnum ) {