[backend/libmfm] Use double.TryParse instead of try/catch
This commit is contained in:
parent
29c5b995dd
commit
dd768242e1
1 changed files with 1 additions and 8 deletions
|
@ -243,14 +243,7 @@ public class MfmConverter(
|
||||||
return Fallback();
|
return Fallback();
|
||||||
|
|
||||||
double timestamp;
|
double timestamp;
|
||||||
try
|
if (!double.TryParse(textNode.Text, out timestamp)) return Fallback();
|
||||||
{
|
|
||||||
timestamp = double.Parse(textNode.Text);
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
return Fallback();
|
|
||||||
}
|
|
||||||
|
|
||||||
var date = DateTime.UnixEpoch.AddSeconds(timestamp);
|
var date = DateTime.UnixEpoch.AddSeconds(timestamp);
|
||||||
el.TextContent = date.ToString("HH:mm, d MMM yyyy") + " UTC";
|
el.TextContent = date.ToString("HH:mm, d MMM yyyy") + " UTC";
|
||||||
|
|
Loading…
Add table
Reference in a new issue