Prevents top to be less than zero if source count is zero.

This commit is contained in:
BDisp
2021-06-02 11:13:08 +01:00
parent a7011befef
commit 2ba1a50f2e

View File

@@ -557,7 +557,7 @@ namespace Terminal.Gui {
/// <returns></returns>
public virtual bool MoveEnd ()
{
if (selected != source.Count - 1) {
if (source.Count > 0 && selected != source.Count - 1) {
selected = source.Count - 1;
top = selected;
OnSelectedChanged ();