File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
plugins/jobs-management/src/JobsListWidget Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -62,9 +62,11 @@ export function stateModelFactory(_pluginManager: PluginManager) {
6262 */
6363 removeJob ( jobName : string ) {
6464 const indx = self . jobs . findIndex ( job => job . name === jobName )
65- const removed = self . jobs [ indx ]
66- self . jobs . splice ( indx , 1 )
67- return removed
65+ if ( indx === - 1 ) {
66+ return undefined
67+ }
68+ const removed = self . jobs . splice ( indx , 1 )
69+ return removed [ 0 ]
6870 } ,
6971 /**
7072 * #action
@@ -110,9 +112,11 @@ export function stateModelFactory(_pluginManager: PluginManager) {
110112 */
111113 removeQueuedJob ( jobName : string ) {
112114 const indx = self . queued . findIndex ( job => job . name === jobName )
113- const removed = self . queued [ indx ]
114- self . queued . splice ( indx , 1 )
115- return removed
115+ if ( indx === - 1 ) {
116+ return undefined
117+ }
118+ const removed = self . queued . splice ( indx , 1 )
119+ return removed [ 0 ]
116120 } ,
117121 /**
118122 * #action
You can’t perform that action at this time.
0 commit comments