mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 18:27:24 +01:00
Fix explicit null values in jsons.
This commit is contained in:
parent
1a75fd953b
commit
925e9fef27
1 changed files with 4 additions and 1 deletions
|
|
@ -27,11 +27,14 @@ namespace Penumbra.Models
|
|||
[JsonIgnore]
|
||||
public bool HasGroupWithConfig { get; set; } = false;
|
||||
|
||||
private static readonly JsonSerializerSettings JsonSettings
|
||||
= new() { NullValueHandling = NullValueHandling.Ignore };
|
||||
|
||||
public static ModMeta? LoadFromFile( string filePath )
|
||||
{
|
||||
try
|
||||
{
|
||||
var meta = JsonConvert.DeserializeObject< ModMeta >( File.ReadAllText( filePath ) );
|
||||
var meta = JsonConvert.DeserializeObject< ModMeta >( File.ReadAllText( filePath ), JsonSettings );
|
||||
meta.HasGroupWithConfig = meta.Groups.Count > 0
|
||||
&& meta.Groups.Values.Any( G => G.SelectionType == SelectType.Multi || G.Options.Count > 1 );
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue