Skip to content

Commit

Permalink
fix - Fixed empty values causing errors
Browse files Browse the repository at this point in the history
---

We've fixed an empty "VALUE=" specifier causing VC to report an error, hence reported as is when saving vCards.

---

Type: fix
Breaking: False
Doc Required: False
Backport Required: False
Part: 1/1
  • Loading branch information
AptiviCEO committed Oct 3, 2024
1 parent ab476b4 commit b34e179
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion VisualCard/Parsers/VcardCommonTools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -494,10 +494,12 @@ internal static string GetFirstValue(ArgumentInfo[] args, string @default, strin
// We're given an array of split arguments of an element delimited by the colon, such as: "...TYPE=home..."
// Filter list of arguments with the arguments that start with the specified specifier (key)
var argFromSpecifier = args.SingleOrDefault((arg) => arg.Key == argSpecifier);
if (argFromSpecifier is null)
return @default;

// Attempt to get the value from the key
string argString =
argFromSpecifier is not null ?
argFromSpecifier.Values.FirstOrDefault() != default ?
argFromSpecifier.Values.First().value :
@default;
return argString;
Expand Down

0 comments on commit b34e179

Please sign in to comment.