diff --git a/Launcher2/Gui/TableWidget/LauncherTableWidget.cs b/Launcher2/Gui/TableWidget/LauncherTableWidget.cs index 2a5dcead7..87a3c5779 100644 --- a/Launcher2/Gui/TableWidget/LauncherTableWidget.cs +++ b/Launcher2/Gui/TableWidget/LauncherTableWidget.cs @@ -58,10 +58,12 @@ namespace Launcher { } void GetScrollbarCoords( out int y, out int height ) { + if( Count == 0 ) { y = 0; height = 0; return; } + float scale = Height / (float)Count; - y = (int)Math.Ceiling(CurrentIndex * scale); - height = (int)Math.Ceiling((maxIndex - CurrentIndex) * scale); - height = Math.Min(y + height, Height) - y; + y = (int)Math.Ceiling( CurrentIndex * scale ); + height = (int)Math.Ceiling( (maxIndex - CurrentIndex) * scale ); + height = Math.Min( y + height, Height ) - y; } public void SetSelected( int index ) {