From 786e5f91e16bc3a709ef06d0ffa1808bd92a6451 Mon Sep 17 00:00:00 2001 From: William Heimbigner Date: Sat, 26 Dec 2015 20:22:59 -0700 Subject: Better undef-checking -> less warnings --- lib/ASM/Commander.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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}} ) { -- cgit v1.2.3