Return older file if new one is null

This commit is contained in:
ansel 2023-01-07 18:15:57 +03:00
parent b47cef838c
commit aaeb43fbb2

View File

@ -130,7 +130,7 @@ namespace osu.Game.Screens.Edit.Setup
private void backgroundChanged(ValueChangedEvent<FileInfo?> file) private void backgroundChanged(ValueChangedEvent<FileInfo?> file)
{ {
if (!ChangeBackgroundImage(file.NewValue!)) if (file.NewValue == null || !ChangeBackgroundImage(file.NewValue))
backgroundChooser.Current.Value = file.OldValue; backgroundChooser.Current.Value = file.OldValue;
updatePlaceholderText(); updatePlaceholderText();
@ -138,7 +138,7 @@ namespace osu.Game.Screens.Edit.Setup
private void audioTrackChanged(ValueChangedEvent<FileInfo?> file) private void audioTrackChanged(ValueChangedEvent<FileInfo?> file)
{ {
if (!ChangeAudioTrack(file.NewValue!)) if (file.NewValue == null || !ChangeAudioTrack(file.NewValue))
audioTrackChooser.Current.Value = file.OldValue; audioTrackChooser.Current.Value = file.OldValue;
updatePlaceholderText(); updatePlaceholderText();