Skip to content

Commit e63dd4f

Browse files
committed
Avoid exception when no item selected yet
1 parent 9e1dc0f commit e63dd4f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Source/ExcelDna.IntelliSense/UIMonitor/PopupListWatcher.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ void _windowWatcher_FormulaEditLocationChanged(object sender, EventArgs e)
9292
var hwndListView = Win32Helper.GetFirstChildWindow(_hwndPopupList);
9393
ListBounds = Win32Helper.GetWindowBounds(_hwndPopupList);
9494
Win32Helper.GetListViewSelectedItemInfo(hwndListView, out text, out itemBounds);
95-
itemBounds.Offset(ListBounds.Left, ListBounds.Top);
95+
if (itemBounds != Rect.Empty)
96+
itemBounds.Offset(ListBounds.Left, ListBounds.Top);
9697
SelectedItemBounds = itemBounds;
9798
OnSelectedItemChanged();
9899
}

0 commit comments

Comments
 (0)