1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 22:33:05 +08:00

Fix potential exception during removal

This commit is contained in:
smoogipoo 2019-12-18 12:03:15 +09:00
parent bcc19e29f2
commit df8f8ffd0d

View File

@ -33,13 +33,14 @@ namespace osu.Game.Rulesets.UI
public virtual bool Remove(DrawableHitObject hitObject) public virtual bool Remove(DrawableHitObject hitObject)
{ {
bool result = RemoveInternal(hitObject); if (!RemoveInternal(hitObject))
return false;
// Removed last for the comparer to remain ordered during RemoveInternal // Removed last for the comparer to remain ordered during RemoveInternal
startTimeMap[hitObject].bindable.UnbindAll(); startTimeMap[hitObject].bindable.UnbindAll();
startTimeMap.Remove(hitObject); startTimeMap.Remove(hitObject);
return result; return true;
} }
private void onStartTimeChanged(DrawableHitObject hitObject) private void onStartTimeChanged(DrawableHitObject hitObject)