Skip to content

Commit

Permalink
fix for empty tag/attrib sections
Browse files Browse the repository at this point in the history
  • Loading branch information
taubenangriff committed Mar 24, 2024
1 parent bde71f1 commit 2d82a9b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions FileDBSerializer/FileDBSerializer/Document/TagSection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,12 @@ public TagSection(Dictionary<ushort, string> tags, Dictionary<ushort, string> at
{
_tags = tags;
_attribs = attribs;
MaxTagID = (ushort)(_tags.Keys.Max() + 1);
MaxAttribID = (ushort)(_attribs.Keys.Max() + 1);
MaxTagID = (ushort)(tags.Keys.Count() > 0 ?
_tags.Keys.Max() + 1
: NoneTag +1);
MaxAttribID = (ushort)(_attribs.Keys.Count() > 0 ?
_attribs.Keys.Max() + 1
: NoneAttrib + 1);
}

public string? GetTagName(int id)
Expand Down

0 comments on commit 2d82a9b

Please sign in to comment.