Skip to content

Commit f0981f6

Browse files
committed
Add a null check for the VolumeConfigurations property
1 parent cabe278 commit f0981f6

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

dist/index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,14 +224,17 @@ async function updateEcsService(ecs, clusterName, service, taskDefArn, waitForSe
224224
taskDefinition: taskDefArn,
225225
forceNewDeployment: forceNewDeployment,
226226
enableECSManagedTags: enableECSManagedTags,
227-
propagateTags: propagateTags,
228-
volumeConfigurations: volumeConfigurations
227+
propagateTags: propagateTags
229228
};
230229

231230
// Add the desiredCount property only if it is defined and a number.
232231
if (!isNaN(desiredCount) && desiredCount !== undefined) {
233232
params.desiredCount = desiredCount;
234233
}
234+
// Add VolumeConfigurations property only it is not null
235+
if(volumeConfigurations !== null){
236+
params.volumeConfigurations = volumeConfigurations;
237+
}
235238
await ecs.updateService(params);
236239

237240
const region = await ecs.config.region();

index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,14 +218,17 @@ async function updateEcsService(ecs, clusterName, service, taskDefArn, waitForSe
218218
taskDefinition: taskDefArn,
219219
forceNewDeployment: forceNewDeployment,
220220
enableECSManagedTags: enableECSManagedTags,
221-
propagateTags: propagateTags,
222-
volumeConfigurations: volumeConfigurations
221+
propagateTags: propagateTags
223222
};
224223

225224
// Add the desiredCount property only if it is defined and a number.
226225
if (!isNaN(desiredCount) && desiredCount !== undefined) {
227226
params.desiredCount = desiredCount;
228227
}
228+
// Add VolumeConfigurations property only it is not null
229+
if(volumeConfigurations !== null){
230+
params.volumeConfigurations = volumeConfigurations;
231+
}
229232
await ecs.updateService(params);
230233

231234
const region = await ecs.config.region();

0 commit comments

Comments
 (0)