Procházet zdrojové kódy

Merge pull request #5 from horgh/master

Fix undefined warning when generating music charts
walle303 před 9 roky
rodič
revize
1e973fe203
1 změnil soubory, kde provedl 5 přidání a 1 odebrání
  1. 5 1
      modules/Pisg/Parser/Logfile.pm

+ 5 - 1
modules/Pisg/Parser/Logfile.pm

@@ -746,7 +746,11 @@ sub _uniquify_nicks {
                 $stats->{word_upcase}{$realnick} ||= $stats->{word_upcase}{$word};
                 delete $stats->{wordcounts}{$word};
                 delete $stats->{wordnicks}{$word};
-                delete $stats->{word_upcase}{$word};
+                # We need the word case translation around if it is used as a
+                # song name.
+                if (!defined $stats->{chartcounts}{$word}) {
+                  delete $stats->{word_upcase}{$word};
+                }
             }
         }
     }