Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS will be completely phased out by mid-2025. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit ace0857a authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

header may be missing in case of invalid file

parent 65e6d4cf
No related branches found
No related tags found
No related merge requests found
......@@ -67,7 +67,7 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON
protected JSONFile(JObject data, string filename, bool tolerateMissing = false)
{
var header = (JObject)data.GetEx(JsonKeys.JsonHeader);
Version = header.GetEx<string>(JsonKeys.JsonHeader_FileVersion);
Version = header[JsonKeys.JsonHeader_FileVersion] != null ? header.GetEx<string>(JsonKeys.JsonHeader_FileVersion) : string.Empty;
Body = (JObject)data.GetEx(JsonKeys.JsonBody);
_sourceFile = Path.GetFullPath(filename);
TolerateMissing = tolerateMissing;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment