File tree Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -104,12 +104,8 @@ public bool Exec()
104104 catch ( Exception e )
105105 {
106106 if ( RaiseError )
107- {
108- Dispatcher . UIThread . Invoke ( ( ) =>
109- {
110- App . RaiseException ( Context , e . Message ) ;
111- } ) ;
112- }
107+ Dispatcher . UIThread . Post ( ( ) => App . RaiseException ( Context , e . Message ) ) ;
108+
113109 return false ;
114110 }
115111
@@ -120,15 +116,15 @@ public bool Exec()
120116 int exitCode = proc . ExitCode ;
121117 proc . Close ( ) ;
122118
123- if ( ! isCancelled && exitCode != 0 && errs . Count > 0 )
119+ if ( ! isCancelled && exitCode != 0 )
124120 {
125121 if ( RaiseError )
126122 {
127- Dispatcher . UIThread . Invoke ( ( ) =>
128- {
129- App . RaiseException ( Context , string . Join ( "\n " , errs ) ) ;
130- } ) ;
123+ var errMsg = string . Join ( "\n " , errs ) ;
124+ if ( ! string . IsNullOrWhiteSpace ( errMsg ) )
125+ Dispatcher . UIThread . Post ( ( ) => App . RaiseException ( Context , errMsg ) ) ;
131126 }
127+
132128 return false ;
133129 }
134130
You can’t perform that action at this time.
0 commit comments