From: Ivan Kohler Date: Wed, 28 Nov 2018 21:17:47 +0000 (-0800) Subject: fix error linking legacy services, RT#81818 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=a08d811960f14200ccafebcbe24dde8cf3f3ccb2 fix error linking legacy services, RT#81818 --- diff --git a/FS/FS/cust_svc.pm b/FS/FS/cust_svc.pm index 4aa7504f7..9e16142e0 100644 --- a/FS/FS/cust_svc.pm +++ b/FS/FS/cust_svc.pm @@ -453,8 +453,10 @@ sub replace { #my $error = $new->SUPER::replace($old, @_); my $error = $new->SUPER::replace($old); - #trigger a relocate export on location changes - if ( $new->cust_pkg->locationnum != $old->cust_pkg->locationnum ) { + #trigger a relocate export on location changes (NENA2 and Northern 911 export) + my $old_pkg = $old->cust_pkg; + my $new_pkg = $new->cust_pkg; + if ( $old_pkg && $new_pkg && $new_pkg->locationnum != $old_pkg->locationnum ) { my $svc_x = $new->svc_x; if ( $svc_x->locationnum ) { if ( $svc_x->locationnum == $old->cust_pkg->locationnum ) {