From fd2e020eec6c01661e87ca5efbca6ed784c6f2bc Mon Sep 17 00:00:00 2001 From: Adam <893184+NotAdam@users.noreply.github.com> Date: Mon, 25 Jan 2021 14:01:17 +1100 Subject: [PATCH] fix a case where an old json would outright break penumbra --- Penumbra/Mods/ModCollection.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Penumbra/Mods/ModCollection.cs b/Penumbra/Mods/ModCollection.cs index 6669f414..4c6eea78 100644 --- a/Penumbra/Mods/ModCollection.cs +++ b/Penumbra/Mods/ModCollection.cs @@ -64,7 +64,19 @@ namespace Penumbra.Mods continue; } - var meta = JsonConvert.DeserializeObject< ModMeta >( File.ReadAllText( metaFile.FullName ) ); + ModMeta meta; + + try + { + meta = JsonConvert.DeserializeObject< ModMeta >( File.ReadAllText( metaFile.FullName ) ); + } + catch( Exception e ) + { + PluginLog.Error( e, "failed to parse mod info, attempting basic load for: {FilePath}", metaFile.FullName ); + continue; + + // todo: handle broken mods properly + } var mod = new ResourceMod {