Skip to content

Commit

Permalink
fix: missing check for FileID when deserializing EngineObject header
Browse files Browse the repository at this point in the history
  • Loading branch information
sinnwrig committed Oct 10, 2024
1 parent eb0f712 commit 58bb72b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Prowl.Runtime/EngineObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ protected void SerializeHeader(SerializedProperty compound)
if (AssetID != Guid.Empty)
{
compound.Add("AssetID", new SerializedProperty(AssetID.ToString()));

if (FileID != 0)
compound.Add("FileID", new SerializedProperty(FileID));
}
Expand All @@ -172,7 +173,11 @@ protected void DeserializeHeader(SerializedProperty value)
if (value.TryGet("AssetID", out var assetIDTag))
{
AssetID = Guid.Parse(assetIDTag.StringValue);
FileID = value.Get("FileID").UShortValue;

if (value.TryGet("FileID", out var fileIDTag))
FileID = fileIDTag.UShortValue;
else
FileID = 0;
}
}
}
Expand Down

0 comments on commit 58bb72b

Please sign in to comment.