X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_pkg.pm;h=16adea3d79a39b2265ae1ed4b097438e40c316d4;hb=2b4bb0058f931376a3169d596aa31a17e3f46b04;hp=c34eb43b5374279484fb1c89a7d707feda54e8c9;hpb=f8c8b9782ff5400790c2fb6dae017ce01790e56e;p=freeside.git diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm index c34eb43b5..16adea3d7 100644 --- a/FS/FS/cust_pkg.pm +++ b/FS/FS/cust_pkg.pm @@ -1427,7 +1427,8 @@ sub unsuspend { } - my $reason = $self->last_cust_pkg_reason('susp')->reason; + my $cust_pkg_reason = $self->last_cust_pkg_reason('susp'); + my $reason = $cust_pkg_reason ? $cust_pkg_reason->reason : ''; my %hash = $self->hash; my $inactive = time - $hash{'susp'}; @@ -1457,7 +1458,7 @@ sub unsuspend { my $unsusp_pkg; - if ( $reason->unsuspend_pkgpart ) { + if ( $reason && $reason->unsuspend_pkgpart ) { my $part_pkg = FS::part_pkg->by_key($reason->unsuspend_pkgpart) or $error = "Unsuspend package definition ".$reason->unsuspend_pkgpart. " not found.";