@@ -250,39 +250,42 @@ class StudioActions {
250
250
title : `Executing user action: ${ action . label } ` ,
251
251
} ,
252
252
( ) => {
253
- return new Promise ( ( resolve ) => {
254
- this . api
255
- . actionQuery ( query , parameters )
256
- . then ( async ( data ) => {
257
- if ( action . save ) {
258
- await this . processSaveFlag ( action . save ) ;
259
- }
260
- if ( ! afterUserAction ) {
261
- outputConsole ( data . console ) ;
262
- }
263
- const actionToProcess = data . result . content . pop ( ) ;
253
+ return this . api
254
+ . actionQuery ( query , parameters )
255
+ . then ( async ( data ) => {
256
+ if ( action . save ) {
257
+ await this . processSaveFlag ( action . save ) ;
258
+ }
259
+ if ( ! afterUserAction ) {
260
+ outputConsole ( data . console ) ;
261
+ }
262
+ if ( ! data . result . content . length ) {
263
+ // nothing to-do, just ignore it
264
+ return ;
265
+ }
266
+ const actionToProcess = data . result . content . pop ( ) ;
264
267
265
- // CSP pages should not have a progress bar
266
- if ( actionToProcess . action === 2 ) {
267
- resolve ( ) ;
268
- }
269
- return actionToProcess ;
270
- } )
271
- . then ( this . processUserAction )
272
- . then ( ( answer ) => {
273
- if ( answer ) {
274
- return answer . msg || answer . msg === ""
268
+ // CSP pages should not have a progress bar
269
+ if ( actionToProcess . action === 2 ) {
270
+ return ;
271
+ }
272
+ return actionToProcess ;
273
+ } )
274
+ . then (
275
+ ( actionToProcess ) =>
276
+ actionToProcess &&
277
+ this . processUserAction ( actionToProcess ) . then ( ( answer ) =>
278
+ answer && ( answer . msg || answer . msg === "" )
275
279
? this . userAction ( action , true , answer . answer , answer . msg , type )
276
- : this . userAction ( action , true , answer , "" , type ) ;
277
- }
278
- } )
279
- . then ( ( ) => resolve ( ) )
280
- . catch ( ( err ) => {
281
- console . log ( err ) ;
282
- outputChannel . appendLine ( `Studio Action "${ action . label } " not supported` ) ;
283
- outputChannel . show ( ) ;
284
- } ) ;
285
- } ) ;
280
+ : this . userAction ( action , true , answer , "" , type )
281
+ )
282
+ )
283
+ . catch ( ( err ) => {
284
+ console . log ( err ) ;
285
+ outputChannel . appendLine ( `Studio Action "${ action . label } " not supported` ) ;
286
+ outputChannel . show ( ) ;
287
+ return Promise . reject ( ) ;
288
+ } ) ;
286
289
}
287
290
) ;
288
291
}
0 commit comments