Skip to content

Commit 7814eef

Browse files
committed
Fix potential NullReferenceException in CompletionList.set_SelectedItem.
1 parent f69aee2 commit 7814eef

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

ICSharpCode.AvalonEdit/CodeCompletion/CompletionList.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,8 @@ public ICompletionData SelectedItem {
199199
set {
200200
if (listBox == null && value != null)
201201
ApplyTemplate();
202-
listBox.SelectedItem = value;
202+
if (listBox != null) // may still be null if ApplyTemplate fails, or if listBox and value both are null
203+
listBox.SelectedItem = value;
203204
}
204205
}
205206

0 commit comments

Comments
 (0)