fix error on changing customer when there isn't an implicit contact, RT#76405
[freeside.git] / FS / FS / cust_main.pm
index d11fdad..f6c3ff7 100644 (file)
@@ -1520,8 +1520,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 ) {