tmesser / DeckManager

BSD 3-Clause "New" or "Revised" License
5 stars 2 forks source link

Opening an empty turn log crashes #33

Closed MaxPeck closed 9 years ago

MaxPeck commented 9 years ago

1) start or load a game 2) pass the turn, click through the reminder 3) open the turn log 4)

System.InvalidOperationException: Sequence contains no elements
   at System.Linq.Enumerable.Average(IEnumerable`1 source)
   at DeckManagerOutput.HelpForm..ctor(String toDisplay, String title)
...

It doesn't like doing widthList.Average() when widthList is empty, and I don't know what you want it to do when this happens.

tmesser commented 9 years ago

Either not open at all or open at a minimum width (like 50?) and an empty string. Either should be simple to handle, I will see about sorting this out today or tomorrow.

tmesser commented 9 years ago

Fixed.