From 0da5c90a1359f94a692427b36c74aa47b4987569 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chris=20G=C3=A5rdenberg?= Date: Tue, 26 Sep 2017 16:56:57 +0200 Subject: [PATCH] Doing a long.TryParse instead of direct cast to long. --- MN.L10n/L10n.cs | 6 +++++- MN.L10n/MN.L10n.csproj | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/MN.L10n/L10n.cs b/MN.L10n/L10n.cs index 3bb7de8..2eea170 100644 --- a/MN.L10n/L10n.cs +++ b/MN.L10n/L10n.cs @@ -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; diff --git a/MN.L10n/MN.L10n.csproj b/MN.L10n/MN.L10n.csproj index d2d3a7b..c91da33 100644 --- a/MN.L10n/MN.L10n.csproj +++ b/MN.L10n/MN.L10n.csproj @@ -12,7 +12,7 @@ Translation package https://github.com/MultinetInteractive/MN.L10n git © 20XX MultiNet Interactive AB - 1.0.100 + 1.0.101 True