[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();
|
||||
|
||||
double timestamp;
|
||||
try
|
||||
{
|
||||
timestamp = double.Parse(textNode.Text);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return Fallback();
|
||||
}
|
||||
if (!double.TryParse(textNode.Text, out timestamp)) return Fallback();
|
||||
|
||||
var date = DateTime.UnixEpoch.AddSeconds(timestamp);
|
||||
el.TextContent = date.ToString("HH:mm, d MMM yyyy") + " UTC";
|
||||
|
|
Loading…
Add table
Reference in a new issue