Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,14 @@ private async Task<List<ComboBox>> GetNavigationBarComboBoxesAsync(IWpfTextView
await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken);

var margin = await GetNavigationBarMarginAsync(textView, cancellationToken);
return margin.GetFieldValue<List<ComboBox>>("_combos");
try
{
return margin.GetFieldValue<List<ComboBox>>("_combos");
}
catch (FieldAccessException)
{
return margin.GetFieldValue<List<ComboBox>>("Combos");
}
}

private async Task<UIElement?> GetNavigationBarMarginAsync(IWpfTextView textView, CancellationToken cancellationToken)
Expand Down
2 changes: 1 addition & 1 deletion src/Workspaces/CoreTestUtilities/ObjectExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public static object GetFieldValue(this object instance, string fieldName)

if (fieldInfo == null)
{
throw new FieldAccessException("Field " + fieldName + " was not found on type " + type.ToString());
throw new FieldAccessException($"Field '{fieldName}' was not found on type '{instance.GetType()}'");
}

var result = fieldInfo.GetValue(instance);
Expand Down
Loading