NuGet/NuGetGallery — pull request #528 by akoeplinger (2012-06-15 10:45:39+00:00)
Title: Fixed exception in AggregateStatsService.cs when database is empty

This PR fixes an exception that is thrown in the AggregateStatsService when the database is empty and contains no packages/downloads. The "DownloadCount" part of the SQL query returned NULL then, so I added an IsDBNull() check.

I also changed the String.Format() of the JSON response, so a value of "0" is included in the response. The format string is now the same as the one used in [_ListPackage.cshtml](https://github.com/NuGet/NuGetGallery/blob/master/Website/Views/Packages/_ListPackage.cshtml#L30) when showing total downloads count.