Skip to content

Commit 334af52

Browse files
len-roCopilot
andauthored
Apply suggestion from @Copilot
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 64914e5 commit 334af52

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

src/main/groovy/com/rundeck/plugins/ansible/ansible/AnsibleRunnerContextBuilder.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -998,12 +998,21 @@ public Map<String,String> getJobOptions(){
998998
if (context.getDataContext() == null) {
999999
return options;
10001000
}
1001+
Map<String, String> jobOptions = context.getDataContext().get("job");
1002+
if (jobOptions == null) {
1003+
return options;
1004+
1005+
if (context == null || context.getDataContext() == null) {
1006+
return options;
1007+
}
1008+
10011009
Map<String, String> jobOptions = context.getDataContext().get("job");
10021010
if (jobOptions == null) {
10031011
return options;
10041012
}
1013+
10051014
for (Map.Entry<String, String> entry : jobOptions.entrySet()) {
1006-
if(entry.getValue() != null) {
1015+
if (entry.getValue() != null) {
10071016
options.put("RD_JOB_" + entry.getKey().toUpperCase(), entry.getValue());
10081017
}
10091018
}

0 commit comments

Comments
 (0)