Skip to content

Commit d73d1f0

Browse files
authored
b/325757513 Ignore double-clicks when no file selected (#1304)
This fixes a spuriuous source of NullReferenceExceptions.
1 parent 79197ec commit d73d1f0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sources/Google.Solutions.Mvvm/Controls/FileBrowser.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,8 @@ private async void fileList_DoubleClick(object sender, EventArgs args)
288288
throw new InvalidOperationException("Control is not bound");
289289
}
290290

291-
if (this.fileList.SelectedModelItem.Type.IsFile)
291+
if (this.fileList.SelectedModelItem == null ||
292+
this.fileList.SelectedModelItem.Type.IsFile)
292293
{
293294
return;
294295
}

0 commit comments

Comments
 (0)