Fixes #1985 by only calling getStats() when the elem array has items (instead of just non-null).
Merge pull request #1986 from NuGet/jeffhand/1985-statstotals

Fixes #1985 by only calling getStats() when the elem array has items...