@@ -116,13 +116,19 @@ await IOUtil.UnzipFiles(path, tempFolder, (file) =>
116
116
var metaPath = Path . Combine ( path , "meta.json" ) ;
117
117
118
118
var text = File . ReadAllText ( metaPath ) ;
119
- var meta = JsonConvert . DeserializeObject < PMPMetaJson > ( text ) ;
119
+ var meta = JsonConvert . DeserializeObject < PMPMetaJson > ( text , new JsonSerializerSettings
120
+ {
121
+ NullValueHandling = NullValueHandling . Ignore
122
+ } ) ;
120
123
121
124
string image = null ;
122
125
123
126
124
127
125
- var defaultOption = JsonConvert . DeserializeObject < PMPOptionJson > ( File . ReadAllText ( defModPath ) ) ;
128
+ var defaultOption = JsonConvert . DeserializeObject < PMPOptionJson > ( File . ReadAllText ( defModPath ) , new JsonSerializerSettings
129
+ {
130
+ NullValueHandling = NullValueHandling . Ignore
131
+ } ) ;
126
132
127
133
var groups = new List < PMPGroupJson > ( ) ;
128
134
@@ -132,7 +138,10 @@ await IOUtil.UnzipFiles(path, tempFolder, (file) =>
132
138
{
133
139
if ( Path . GetFileName ( file ) . StartsWith ( "group_" ) && Path . GetFileName ( file ) . ToLower ( ) . EndsWith ( ".json" ) )
134
140
{
135
- var group = JsonConvert . DeserializeObject < PMPGroupJson > ( File . ReadAllText ( file ) ) ;
141
+ var group = JsonConvert . DeserializeObject < PMPGroupJson > ( File . ReadAllText ( file ) , new JsonSerializerSettings
142
+ {
143
+ NullValueHandling = NullValueHandling . Ignore
144
+ } ) ;
136
145
if ( group != null )
137
146
{
138
147
groups . Add ( group ) ;
@@ -1300,12 +1309,12 @@ public string GetHeaderImage()
1300
1309
public class PMPMetaJson
1301
1310
{
1302
1311
public int FileVersion ;
1303
- public string Name ;
1304
- public string Author ;
1305
- public string Description ;
1306
- public string Version ;
1307
- public string Website ;
1308
- public string Image ;
1312
+ public string Name = "" ;
1313
+ public string Author = "" ;
1314
+ public string Description = "" ;
1315
+ public string Version = "" ;
1316
+ public string Website = "" ;
1317
+ public string Image = "" ;
1309
1318
1310
1319
// These exist.
1311
1320
public List < string > ModTags ;
@@ -1315,14 +1324,14 @@ public class PMPMetaJson
1315
1324
[ JsonSubtypes . KnownSubType ( typeof ( PMPImcGroupJson ) , "Imc" ) ]
1316
1325
public class PMPGroupJson
1317
1326
{
1318
- public string Name ;
1319
- public string Description ;
1327
+ public string Name = "" ;
1328
+ public string Description = "" ;
1320
1329
public int Priority ;
1321
- public string Image ;
1330
+ public string Image = "" ;
1322
1331
public int Page ;
1323
1332
1324
1333
// "Multi", "Single", or "Imc"
1325
- public string Type ;
1334
+ public string Type = "" ;
1326
1335
1327
1336
// Only used internally when the user is selecting options during install/application.
1328
1337
[ JsonIgnore ] public int SelectedSettings = - 1 ;
@@ -1335,8 +1344,8 @@ public class PMPGroupJson
1335
1344
1336
1345
public class PMPImcGroupJson : PMPGroupJson
1337
1346
{
1338
- public PMPImcManipulationJson . PMPImcEntry DefaultEntry ;
1339
1347
public PmpIdentifierJson Identifier ;
1348
+ public PMPImcManipulationJson . PMPImcEntry DefaultEntry ;
1340
1349
public bool AllVariants ;
1341
1350
public bool OnlyAttributes ;
1342
1351
@@ -1387,22 +1396,22 @@ public static PmpIdentifierJson FromRoot(XivDependencyRootInfo root, int variant
1387
1396
}
1388
1397
1389
1398
[ JsonConverter ( typeof ( JsonSubtypes ) ) ]
1390
- [ JsonSubtypes . KnownSubTypeWithProperty ( typeof ( PmpStandardOptionJson ) , "Files" ) ]
1399
+ [ JsonSubtypes . FallBackSubType ( typeof ( PmpStandardOptionJson ) ) ]
1391
1400
[ JsonSubtypes . KnownSubTypeWithProperty ( typeof ( PmpDisableImcOptionJson ) , "IsDisableSubMod" ) ]
1392
1401
[ JsonSubtypes . KnownSubTypeWithProperty ( typeof ( PmpImcOptionJson ) , "AttributeMask" ) ]
1393
1402
public class PMPOptionJson
1394
1403
{
1395
- public string Name ;
1396
- public string Description ;
1397
- public string Image ;
1404
+ public string Name = "" ;
1405
+ public string Description = "" ;
1406
+ public string Image = "" ;
1398
1407
}
1399
1408
1400
1409
public class PmpStandardOptionJson : PMPOptionJson
1401
1410
{
1402
- public Dictionary < string , string > Files ;
1403
- public Dictionary < string , string > FileSwaps ;
1404
- public List < PMPManipulationWrapperJson > Manipulations ;
1405
- public int Priority ;
1411
+ public int Priority = 0 ;
1412
+ public Dictionary < string , string > Files = new ( ) ;
1413
+ public Dictionary < string , string > FileSwaps = new ( ) ;
1414
+ public List < PMPManipulationWrapperJson > Manipulations = new ( ) ;
1406
1415
1407
1416
[ JsonIgnore ] public bool IsEmptyOption => ! (
1408
1417
( FileSwaps != null && FileSwaps . Count > 0 ) ||
0 commit comments