Browse Source

Fix unitialized values

Morten Brix Pedersen 24 years ago
parent
commit
99e1a08966
2 changed files with 7 additions and 2 deletions
  1. 4 0
      docs/Changelog
  2. 3 2
      modules/Pisg/HTMLGenerator.pm

+ 4 - 0
docs/Changelog

@@ -1,3 +1,7 @@
+pisg (x.xx)
+   * When ShowMostAtiveByHour was enabled, unitialized values could appear
+     which caused the HTML file not to be created. (thanks, Gissehel)
+
 pisg (0.39) - Tue May, 14th 2002
    * ShowFoulLine option added (thanks, Adam Spiers <adam@spiers.net>).
    * The "foul-words" counting is now done word-wise instead of line-wise

+ 3 - 2
modules/Pisg/HTMLGenerator.pm

@@ -1711,7 +1711,7 @@ sub _mostnicks
 
 sub _mostactivebyhour
 {
-    # List showing the user with most used nicks
+    # Charts for most active nicks by hour (0-5, 6-11, 12-17, 18-23)
     my $self = shift;
 
     my $sortnicks;
@@ -1727,9 +1727,10 @@ sub _mostactivebyhour
               <=>
               (defined $self->{stats}->{line_times}{$a}[$period]?$self->{stats}->{line_times}{$a}[$period]:0)
         }
-        keys %{ $self->{stats}->{nicks} } ;
+        keys %{ $self->{stats}->{line_times} } ;
 
         for(my $i = 0; $i < $self->{cfg}->{activenicksbyhour}; $i++) {
+            next if ! $sortnicks[$i];
             next if is_ignored($sortnicks[$i]);
             last unless $i < @sortnicks;