Browse Source

ignore invalid channels when loading search

Byron Jones 6 years ago
parent
commit
93b7e8e99f
1 changed files with 4 additions and 1 deletions
  1. 4 1
      lib/LogBot/Web/Search.pm

+ 4 - 1
lib/LogBot/Web/Search.pm

@@ -31,7 +31,10 @@ sub render {
     }
 
     my $ch = $c->param('ch') // '';
-    $ch = normalise_channel($ch) if $ch ne '';
+    if ($ch ne '') {
+        $ch = normalise_channel($ch);
+        $ch = '' unless any { $_ eq $ch } keys %{ $config->{channels} };
+    }
 
     # searching for a ymd date redirects to that date
     if ($ch ne '' && $q =~ /^(\d\d\d\d)-?(\d\d)-?(\d\d)$/) {