projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
df98a7e
)
fix unsuspending packages which didn't have a suspend reason, fallout from #6587
author
Ivan Kohler
<ivan@freeside.biz>
Fri, 28 Sep 2012 19:23:22 +0000
(12:23 -0700)
committer
Ivan Kohler
<ivan@freeside.biz>
Fri, 28 Sep 2012 19:23:22 +0000
(12:23 -0700)
FS/FS/cust_pkg.pm
patch
|
blob
|
history
diff --git
a/FS/FS/cust_pkg.pm
b/FS/FS/cust_pkg.pm
index
c34eb43
..
16adea3
100644
(file)
--- 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'};
my %hash = $self->hash;
my $inactive = time - $hash{'susp'};
@@
-1457,7
+1458,7
@@
sub unsuspend {
my $unsusp_pkg;
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.";
my $part_pkg = FS::part_pkg->by_key($reason->unsuspend_pkgpart)
or $error = "Unsuspend package definition ".$reason->unsuspend_pkgpart.
" not found.";