diff --git a/source/funkin/play/song/SongMigrator.hx b/source/funkin/play/song/SongMigrator.hx index 81500406d..f561c4d3e 100644 --- a/source/funkin/play/song/SongMigrator.hx +++ b/source/funkin/play/song/SongMigrator.hx @@ -108,23 +108,6 @@ class SongMigrator trace('Migrating song metadata from FNF Legacy.'); var songData:FNFLegacy = cast jsonData; - // Some cleanup - if (Std.isOfType(jsonData.song.notes, Array)) - { - jsonData.song.notes = haxe.ds.Either.Left(jsonData.song.notes); - } - else - { - jsonData.song.notes = haxe.ds.Either.Right(jsonData.song.notes); - } - if (Std.isOfType(jsonData.song.speed, Float)) - { - jsonData.song.speed = haxe.ds.Either.Left(jsonData.song.speed); - } - else - { - jsonData.song.speed = haxe.ds.Either.Right(jsonData.song.speed); - } var songMetadata:SongMetadata = new SongMetadata('Import', 'Kawai Sprite', 'default'); diff --git a/source/funkin/util/SerializerUtil.hx b/source/funkin/util/SerializerUtil.hx index 662c05250..9452b7785 100644 --- a/source/funkin/util/SerializerUtil.hx +++ b/source/funkin/util/SerializerUtil.hx @@ -44,7 +44,16 @@ class SerializerUtil */ public static function fromJSONBytes(input:Bytes):Dynamic { - return Json.parse(input.toString()); + try + { + return Json.parse(input.toString()); + } + catch (e:Dynamic) + { + trace('An error occurred while parsing JSON from byte data'); + trace(e); + return null; + } } /**