saritasa-nest / saritasa-dotnet-tools

Development Tools For Company'S .NET Projects.
BSD 2-Clause "Simplified" License
27 stars 13 forks source link

ArgumentNullException in StringUtils.ParseOrDefault #74

Closed AntonZiminSaritasa closed 2 years ago

AntonZiminSaritasa commented 3 years ago
StringUtils.ParseOrDefault<int>(null, 0)
AntonZiminSaritasa commented 3 years ago

Actually, it throws another exception:

Unhandled exception. System.ArgumentException: Type provided must be an Enum.

I'm using it incorrectly. Correct usage:

StringUtils.ParseOrDefault(null, 0)
krasninja commented 3 years ago

You are right, but I do believe that the StringUtils.ParseOrDefault<int> form is still valid. I will update the lib to handle these calls using fallback methods.