Skip to content

Commit

Permalink
Improve null handling in package version parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveDesmond-ca committed Feb 28, 2024
1 parent 8086842 commit ad25039
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/LibYear.Core/PackageVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public PackageVersion(string version)
}
}

public PackageVersion(NuGetVersion? version)
public PackageVersion(NuGetVersion version)
: base(version)
{
}
Expand All @@ -40,9 +40,9 @@ public override string ToString()
? ToString("N", VersionFormatter.Instance)
: OriginalVersion;

public override string ToString(string format, IFormatProvider? formatProvider)
public override string ToString(string? format, IFormatProvider? formatProvider)
{
if (formatProvider == null || !TryFormatter(format, formatProvider, out var formattedString))
if (format == null || formatProvider == null || !TryFormatter(format, formatProvider, out var formattedString))
{
formattedString = ToString();
}
Expand Down

0 comments on commit ad25039

Please sign in to comment.