diff options
| author | 2015-12-26 20:22:59 -0700 | |
|---|---|---|
| committer | 2015-12-26 20:22:59 -0700 | |
| commit | 786e5f91e16bc3a709ef06d0ffa1808bd92a6451 (patch) | |
| tree | cee07015f6739c6650e1d5ad170bcd8fa8c86914 /lib/ASM | |
| parent | d723856b8443154e76a6954ae994181a2b9cb034 (diff) | |
Better undef-checking -> less warnings
Diffstat (limited to 'lib/ASM')
| -rw-r--r-- | lib/ASM/Commander.pm | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/ASM/Commander.pm b/lib/ASM/Commander.pm index aa79f4d..d864800 100644 --- a/lib/ASM/Commander.pm +++ b/lib/ASM/Commander.pm @@ -23,7 +23,10 @@ sub command my $cmd = $args; my $d1; my $nick = lc $event->{nick}; - my $acct = lc $::sn{$nick}->{account}; + my $acct; + if (defined($::sn{$nick}) && defined($::sn{$nick}->{account})) { + $acct = lc $::sn{$nick}->{account}; + } # return 0 unless (ASM::Util->speak($event->{to}->[0])); foreach my $command ( @{$::commands->{command}} ) { |
