3G port-Avoid exceptions starting an empty ExtApp

Reference: https://github.com/kmscode/mRemote3G/issues/10

In my testing the crash was semi-random. The exception was thrown,
logged and put into Notifications (all as expected). But every now and
then, would crash (with no further info available). Could not reproduce
in a debug build.

b248849428
This commit is contained in:
Sean Kaim
2016-05-18 21:56:39 -04:00
parent 46985ab39d
commit a792c98630

View File

@@ -56,8 +56,11 @@ namespace mRemoteNG.Tools
{
try
{
if (string.IsNullOrEmpty(FileName))
throw (new InvalidOperationException("FileName cannot be blank."));
if (string.IsNullOrEmpty(FileName))
{
Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, "ExternalApp.Start() failed: FileName cannot be blank.", false);
return;
}
ConnectionInfo = startConnectionInfo;