From 0d5f84f23ae922d5b64a3978dbbb5183fd89a2e2 Mon Sep 17 00:00:00 2001 From: Mark Date: Mon, 21 Jan 2019 00:00:22 +0800 Subject: [PATCH] Fix for #581 --- TVRename/Utility/Helper/Helpers.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/TVRename/Utility/Helper/Helpers.cs b/TVRename/Utility/Helper/Helpers.cs index 67da2d054..89f5ef7ab 100644 --- a/TVRename/Utility/Helper/Helpers.cs +++ b/TVRename/Utility/Helper/Helpers.cs @@ -14,6 +14,7 @@ using System.ComponentModel; using System.Diagnostics; using System.Diagnostics.Contracts; +using System.IO; using System.Linq; using System.Reflection; using System.Windows.Forms; @@ -208,6 +209,8 @@ public static DateTime FromUnixTime(long unixTime) public static bool SysOpen(string what, string arguments = null) { + if (string.IsNullOrWhiteSpace(what)) return false; + try { Process.Start(what, arguments); @@ -218,6 +221,11 @@ public static bool SysOpen(string what, string arguments = null) Logger.Warn(e); return false; } + catch (FileNotFoundException e) + { + Logger.Warn(e); + return false; + } catch (Exception e) { Logger.Error(e);