mirror of
https://github.com/ppy/osu
synced 2024-12-23 23:33:36 +00:00
Ignore possible nulls from stream reader in IPC
Any failures will be caught. They're not logged, but they also weren't before. Error handling can be improved at a future date, this series of changes is primarily intending to unblock a new inspection.
This commit is contained in:
parent
d581e0a252
commit
ae71389ebe
@ -7,6 +7,7 @@ using System.Linq;
|
||||
using JetBrains.Annotations;
|
||||
using Microsoft.Win32;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Extensions.ObjectExtensions;
|
||||
using osu.Framework.Logging;
|
||||
using osu.Framework.Platform;
|
||||
using osu.Framework.Threading;
|
||||
@ -77,8 +78,8 @@ namespace osu.Game.Tournament.IPC
|
||||
using (var stream = IPCStorage.GetStream(file_ipc_filename))
|
||||
using (var sr = new StreamReader(stream))
|
||||
{
|
||||
var beatmapId = int.Parse(sr.ReadLine());
|
||||
var mods = int.Parse(sr.ReadLine());
|
||||
var beatmapId = int.Parse(sr.ReadLine().AsNonNull());
|
||||
var mods = int.Parse(sr.ReadLine().AsNonNull());
|
||||
|
||||
if (lastBeatmapId != beatmapId)
|
||||
{
|
||||
@ -124,7 +125,7 @@ namespace osu.Game.Tournament.IPC
|
||||
using (var stream = IPCStorage.GetStream(file_ipc_state_filename))
|
||||
using (var sr = new StreamReader(stream))
|
||||
{
|
||||
State.Value = (TourneyState)Enum.Parse(typeof(TourneyState), sr.ReadLine());
|
||||
State.Value = (TourneyState)Enum.Parse(typeof(TourneyState), sr.ReadLine().AsNonNull());
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
|
Loading…
Reference in New Issue
Block a user