StevenReitsma / lolcognac-website

League of Legends Championship website.
4 stars 4 forks source link

Schedule and Statistics page crash server #17

Closed jvanvugt closed 8 years ago

jvanvugt commented 8 years ago

The Schedule page crashes because it will loop through 32 teams, irregardless of how many are in the database.

A similar issue causes the crash for the Statistics page, because it will try to calculate the average gametime of an empty sequence of games. Inspecting this class also had me wondering why Mongo.Matches.FindAll() is called 4 times instead of just once, and why the statistics are longs instead of decimal values.

Both of these crashed can be avoided with an if statement like 7da8755852e080f023b68332de04541333b7463e

StevenReitsma commented 8 years ago

Looks good, can you make a PR?

jvanvugt commented 8 years ago

What about the statistics? Maybe we should show 1 decimal for the average kills/deaths/assists.

StevenReitsma commented 8 years ago

Let's discuss this in https://github.com/StevenReitsma/lolcognac-website/issues/19