Added try catch for Unix to DateTime to catch invalid inputs. Bumped package version to 1.1.9
This commit is contained in:
@ -29,7 +29,16 @@ namespace MontoyaTech.MySqlPlus
|
|||||||
if (unix == 0)
|
if (unix == 0)
|
||||||
return DateTime.MinValue;
|
return DateTime.MinValue;
|
||||||
|
|
||||||
return new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc).AddSeconds(unix).ToUniversalTime();
|
try
|
||||||
|
{
|
||||||
|
return new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc).AddSeconds(unix).ToUniversalTime();
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
//This isn't great, but if the input value is invalid, just return a min value instead
|
||||||
|
//of crashing everything above us.
|
||||||
|
return DateTime.MinValue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<AssemblyName>MontoyaTech.MySqlPlus</AssemblyName>
|
<AssemblyName>MontoyaTech.MySqlPlus</AssemblyName>
|
||||||
<RootNamespace>MontoyaTech.MySqlPlus</RootNamespace>
|
<RootNamespace>MontoyaTech.MySqlPlus</RootNamespace>
|
||||||
<Title>MontoyaTech.MySqlPlus</Title>
|
<Title>MontoyaTech.MySqlPlus</Title>
|
||||||
<Version>1.1.8</Version>
|
<Version>1.1.9</Version>
|
||||||
<Company>MontoyaTech</Company>
|
<Company>MontoyaTech</Company>
|
||||||
<Description>A simple C# library to help work with MySql.</Description>
|
<Description>A simple C# library to help work with MySql.</Description>
|
||||||
<Copyright>MontoyaTech 2023</Copyright>
|
<Copyright>MontoyaTech 2023</Copyright>
|
||||||
|
Reference in New Issue
Block a user