mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 12:53:11 +08:00
Guard against exception in skin deserialisation
This commit is contained in:
parent
cfc3597e1c
commit
adff418fd2
@ -11,6 +11,7 @@ using osu.Framework.Bindables;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.OpenGL.Textures;
|
using osu.Framework.Graphics.OpenGL.Textures;
|
||||||
using osu.Framework.Graphics.Textures;
|
using osu.Framework.Graphics.Textures;
|
||||||
|
using osu.Framework.Logging;
|
||||||
using osu.Game.Audio;
|
using osu.Game.Audio;
|
||||||
using osu.Game.IO;
|
using osu.Game.IO;
|
||||||
using osu.Game.Screens.Play.HUD;
|
using osu.Game.Screens.Play.HUD;
|
||||||
@ -55,6 +56,8 @@ namespace osu.Game.Skinning
|
|||||||
if (bytes == null)
|
if (bytes == null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
string jsonContent = Encoding.UTF8.GetString(bytes);
|
string jsonContent = Encoding.UTF8.GetString(bytes);
|
||||||
var deserializedContent = JsonConvert.DeserializeObject<IEnumerable<SkinnableInfo>>(jsonContent);
|
var deserializedContent = JsonConvert.DeserializeObject<IEnumerable<SkinnableInfo>>(jsonContent);
|
||||||
|
|
||||||
@ -63,6 +66,11 @@ namespace osu.Game.Skinning
|
|||||||
|
|
||||||
DrawableComponentInfo[skinnableTarget] = deserializedContent.ToArray();
|
DrawableComponentInfo[skinnableTarget] = deserializedContent.ToArray();
|
||||||
}
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Logger.Error(ex, "Failed to load skin configuration.");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
Loading…
Reference in New Issue
Block a user