Skip to content

Commit

Permalink
Added default value handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
svenrog committed Aug 21, 2023
1 parent 0f063c4 commit b83034d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Geta.Optimizely.GenericLinks/LinkData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,10 @@ public virtual object Clone()

Attributes.TryGetValue(GetAttributeKey(key), out var value);

return conversion(value ?? string.Empty);
if (string.IsNullOrEmpty(value))
return default;

return conversion(value);
}

protected virtual void SetAttribute(string? value, [CallerMemberName] string? key = null)
Expand Down

0 comments on commit b83034d

Please sign in to comment.