mirror of https://github.com/ppy/osu
Check if the file exists before reading
This is (also) to address the review from bdach about StorageManager initialising a default value that gets overwritten upon migration anyway.
This commit is contained in:
parent
839f197111
commit
c94f95cc0d
|
@ -22,11 +22,9 @@ public TournamentStorage(Storage storage)
|
|||
|
||||
TournamentStorageManager storageConfig = new TournamentStorageManager(storage);
|
||||
|
||||
var currentTournament = storageConfig.Get<string>(StorageConfig.CurrentTournament);
|
||||
|
||||
if (!string.IsNullOrEmpty(currentTournament))
|
||||
if (storage.Exists("tournament.ini"))
|
||||
{
|
||||
ChangeTargetStorage(UnderlyingStorage.GetStorageForDirectory(currentTournament));
|
||||
ChangeTargetStorage(UnderlyingStorage.GetStorageForDirectory(storageConfig.Get<string>(StorageConfig.CurrentTournament)));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue