diff --git a/addOns/automation/CHANGELOG.md b/addOns/automation/CHANGELOG.md index 53ad0b059d3..2d10ddff2ca 100644 --- a/addOns/automation/CHANGELOG.md +++ b/addOns/automation/CHANGELOG.md @@ -7,6 +7,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Added - Allow to configure the structural parameters of a context (Issue 7780). +### Fixed +- NPE in GUI if the technology was not specified. + ### Changed - Rely on Passive Scanner add-on for the passive scan related jobs (Issue 7959). diff --git a/addOns/automation/src/main/java/org/zaproxy/addon/automation/gui/ContextDialog.java b/addOns/automation/src/main/java/org/zaproxy/addon/automation/gui/ContextDialog.java index eb5f22c6749..1947de79e0d 100644 --- a/addOns/automation/src/main/java/org/zaproxy/addon/automation/gui/ContextDialog.java +++ b/addOns/automation/src/main/java/org/zaproxy/addon/automation/gui/ContextDialog.java @@ -133,11 +133,19 @@ public void save() { this.context.setUrls(stringParamToList(URLS_PARAM)); this.context.setIncludePaths(stringParamToList(INCLUDE_PARAM)); this.context.setExcludePaths(stringParamToList(EXCLUDE_PARAM)); - this.context - .getTechnology() - .setExclude( - TechnologyUtils.techSetToExcludeList( - this.getTechnologyPanel().getTechSet())); + + TechnologyData tech = this.context.getTechnology(); + List excludeTech = + TechnologyUtils.techSetToExcludeList(this.getTechnologyPanel().getTechSet()); + if (tech == null && excludeTech.size() == 0) { + // Can ignore + } else { + if (tech == null) { + tech = new TechnologyData(); + } + tech.setExclude(excludeTech); + this.context.setTechnology(tech); + } context.setStructure(getStructurePanel().getStructure()); if (this.isNew) { envDialog.addContext(context);