1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 13:37:25 +08:00

Ignore skin component json data if deserialisation fails instead

Crashing was not really the best thing to do there given the preceding
code that already allowed a few continues in case of a missing file.
This commit is contained in:
Bartłomiej Dach 2021-05-15 01:01:27 +02:00
parent ae71389ebe
commit 69fc072429

View File

@ -8,7 +8,6 @@ using System.Text;
using Newtonsoft.Json;
using osu.Framework.Audio.Sample;
using osu.Framework.Bindables;
using osu.Framework.Extensions.ObjectExtensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.OpenGL.Textures;
using osu.Framework.Graphics.Textures;
@ -57,8 +56,12 @@ namespace osu.Game.Skinning
continue;
string jsonContent = Encoding.UTF8.GetString(bytes);
var deserializedContent = JsonConvert.DeserializeObject<IEnumerable<SkinnableInfo>>(jsonContent);
DrawableComponentInfo[skinnableTarget] = JsonConvert.DeserializeObject<IEnumerable<SkinnableInfo>>(jsonContent).AsNonNull().ToArray();
if (deserializedContent == null)
continue;
DrawableComponentInfo[skinnableTarget] = deserializedContent.ToArray();
}
}