Write GetName/SetName tests

This commit is contained in:
Matt Nadareski
2025-01-08 13:41:53 -05:00
parent 19efc30c44
commit e6b2aabc2d
2 changed files with 70 additions and 4 deletions

View File

@@ -518,7 +518,7 @@ namespace SabreTools.DatItems
/// <inheritdoc/>
public override string? GetName()
{
if (NameKey != null)
if (!string.IsNullOrEmpty(NameKey))
return GetStringFieldValue(NameKey);
return null;
@@ -527,7 +527,7 @@ namespace SabreTools.DatItems
/// <inheritdoc/>
public override void SetName(string? name)
{
if (NameKey != null)
if (!string.IsNullOrEmpty(NameKey))
SetFieldValue(NameKey, name);
}