From 92ca39f6214c1bb2465b68cadc18d028ee29a49e Mon Sep 17 00:00:00 2001 From: viper3400 Date: Sat, 3 Oct 2015 16:33:55 +0200 Subject: [PATCH] Fix in CallExternalCommand: Exception message "Error calling external command" was shown although CallExternalCommand has finished successful. In addition log4net message has been written before exportInformation.ErrorMessage was set, so exception message was not in log file. --- .../ExternalCommandDestination.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/GreenshotExternalCommandPlugin/ExternalCommandDestination.cs b/GreenshotExternalCommandPlugin/ExternalCommandDestination.cs index d6784855a..ee13f6eee 100644 --- a/GreenshotExternalCommandPlugin/ExternalCommandDestination.cs +++ b/GreenshotExternalCommandPlugin/ExternalCommandDestination.cs @@ -121,7 +121,7 @@ namespace ExternalCommand { if (config.OutputToClipboard) { ClipboardHelper.SetClipboardData(output); } - if (uriMatches != null && uriMatches.Count >= 0) { + if (uriMatches != null && uriMatches.Count > 0) { exportInformation.Uri = uriMatches[0].Groups[1].Value; LOG.InfoFormat("Got URI : {0} ", exportInformation.Uri); if (config.UriToClipboard) { @@ -134,10 +134,10 @@ namespace ExternalCommand { exportInformation.ExportMade = false; exportInformation.ErrorMessage = error; } - } catch (Exception ex) { - LOG.WarnFormat("Error calling external command: {0} ", exportInformation.ErrorMessage); + } catch (Exception ex) { exportInformation.ExportMade = false; exportInformation.ErrorMessage = ex.Message; + LOG.WarnFormat("Error calling external command: {0} ", exportInformation.ErrorMessage); } }