Skip to content

Commit

Permalink
Fix crash when dropdown is removed from hierarchy during select
Browse files Browse the repository at this point in the history
  • Loading branch information
smoogipoo committed May 27, 2024
1 parent eafc2f4 commit 3b26686
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions osu.Framework/Graphics/UserInterface/Dropdown.cs
Original file line number Diff line number Diff line change
Expand Up @@ -839,9 +839,9 @@ void IDropdown.CommitPreselection()
SelectedItem = (DropdownMenuItem<T>)preselectedItem.Item;
}

void IDropdown.TriggerFocusContention(Drawable triggerSource) => GetContainingFocusManager().TriggerFocusContention(triggerSource);
void IDropdown.TriggerFocusContention(Drawable triggerSource) => GetContainingFocusManager()?.TriggerFocusContention(triggerSource);

bool IDropdown.ChangeFocus(Drawable potentialFocusTarget) => GetContainingFocusManager().ChangeFocus(potentialFocusTarget);
bool IDropdown.ChangeFocus(Drawable potentialFocusTarget) => GetContainingFocusManager()?.ChangeFocus(potentialFocusTarget) ?? false;

#endregion
}
Expand Down

0 comments on commit 3b26686

Please sign in to comment.