Skip to content

Commit c84142a

Browse files
committed
1835 Handle the null case properly in setMetadata methods
1 parent 04465f9 commit c84142a

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

server/libs/atlas/atlas-execution/atlas-execution-api/src/main/java/com/bytechef/atlas/execution/domain/Job.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,11 @@ public void setLabel(String label) {
315315
}
316316

317317
public void setMetadata(Map<String, ?> metadata) {
318-
this.metadata = new MapWrapper(metadata);
318+
if (metadata == null) {
319+
this.metadata = new MapWrapper();
320+
} else {
321+
this.metadata = new MapWrapper(metadata);
322+
}
319323
}
320324

321325
public void setOutputs(FileEntry outputs) {

server/libs/atlas/atlas-execution/atlas-execution-api/src/main/java/com/bytechef/atlas/execution/domain/TaskExecution.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,9 @@ public void setMaxRetries(int maxRetries) {
458458
}
459459

460460
public void setMetadata(Map<String, ?> metadata) {
461-
if (metadata != null) {
461+
if (metadata == null) {
462+
this.metadata = new MapWrapper();
463+
} else {
462464
this.metadata = new MapWrapper(metadata);
463465
}
464466
}

0 commit comments

Comments
 (0)