Skip to content

Commit

Permalink
Doing a long.TryParse instead of direct cast to long.
Browse files Browse the repository at this point in the history
  • Loading branch information
itssimple committed Sep 26, 2017
1 parent 564f133 commit 0da5c90
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion MN.L10n/L10n.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,11 @@ public static long GetCount(object args = null)
var t = args.GetType();
foreach (var p in t.GetProperties())
{
if (p.Name == "__count") return (long)p.GetValue(args);
if (p.Name == "__count")
{
long.TryParse(p.GetValue(args).ToString(), out long __count);
return __count;
}
}

return 0;
Expand Down
2 changes: 1 addition & 1 deletion MN.L10n/MN.L10n.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Translation package</Description>
<PackageProjectUrl>https://github.com/MultinetInteractive/MN.L10n</PackageProjectUrl>
<RepositoryType>git</RepositoryType>
<Copyright>© 20XX MultiNet Interactive AB</Copyright>
<Version>1.0.100</Version>
<Version>1.0.101</Version>
<AutoIncrementPackageRevision>True</AutoIncrementPackageRevision>
</PropertyGroup>

Expand Down

0 comments on commit 0da5c90

Please sign in to comment.