]> git.donarmstrong.com Git - infobot.git/blobdiff - src/Misc.pl
- IsHostMatch: check for NULL.
[infobot.git] / src / Misc.pl
index c0e25dc625b84588438d1d9c951c76cbcd9c8c55..9379d7b10dae4e2fda048cfd3e6d580d213a63fc 100644 (file)
@@ -416,7 +416,10 @@ sub IsHostMatch {
        $local{'host'} = &makeHostMask(lc $3);
     }
 
-    if ($thisnuh =~ /^(\S+)!(\S+)@(\S+)/) {
+    if (!defined $thisnuh) {
+       &WARN("IHM: thisnuh == NULL.");
+       return 0;
+    } elsif ($thisnuh =~ /^(\S+)!(\S+)@(\S+)/) {
        $this{'nick'} = lc $1;
        $this{'user'} = lc $2;
        $this{'host'} = &makeHostMask(lc $3);
@@ -475,6 +478,7 @@ sub makeHostMask {
 
     if ($host =~ s/^(\S+!\S+\@)//) {
        &DEBUG("mHM: detected nick!user\@ for host arg; fixing");
+       &DEBUG("nu => $nu");
        $nu = $1;
     }