null check.

This commit is contained in:
morkt 2015-12-30 14:24:52 +04:00
parent 6831125278
commit 7b4a6cac17

View File

@ -114,8 +114,8 @@ namespace GARbro.GUI
// for each item in the range [start, end]
foreach (var item in Items.Cast<object>().Skip (start).Take (end-start+1))
{
var lvi = (ListViewItem)ItemContainerGenerator.ContainerFromItem (item);
if (!lvi.IsSelected)
var lvi = ItemContainerGenerator.ContainerFromItem (item) as ListViewItem;
if (null != lvi && !lvi.IsSelected)
lvi.IsSelected = true;
}
}