Permalink
Browse files

fix: Fix when a combobox SelectedIndex -1 it would crash (#1927)

  • Loading branch information...
glennawatson committed Jan 22, 2019
1 parent ea99102 commit 17d5bfaf62d776f5572f790169f2765fc40d1b48
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/ReactiveUI/Platforms/windows-common/ViewModelViewHost.cs
@@ -181,7 +181,9 @@ private void ResolveViewForViewModel(object viewModel, string contract)

if (viewInstance == null)
{
throw new Exception($"The {nameof(ViewModelViewHost)} could not find a valid view for the view model of type {viewModel.GetType()} and value {viewModel}.");
Content = DefaultContent;
this.Log().Warn($"The {nameof(ViewModelViewHost)} could not find a valid view for the view model of type {viewModel.GetType()} and value {viewModel}.");
return;
}

viewInstance.ViewModel = viewModel;

0 comments on commit 17d5bfa

Please sign in to comment.