Skip to content

Commit ec13288

Browse files
authored
Fix NPE in CodegenIgnoreProcessor.java (fixes #3356) (#7846)
Fixes NullPointerException when using an override ignore file with no parent.
1 parent 1367396 commit ec13288

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

modules/openapi-generator/src/main/java/org/openapitools/codegen/ignore/CodegenIgnoreProcessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ void loadCodegenRules(final File codegenIgnore) throws IOException {
142142
public boolean allowsFile(final File targetFile) {
143143
if(this.ignoreFile == null) return true;
144144

145-
File file = new File(this.ignoreFile.getParentFile().toURI().relativize(targetFile.toURI()).getPath());
145+
File file = new File(this.ignoreFile.getAbsoluteFile().getParentFile().toURI().relativize(targetFile.toURI()).getPath());
146146
Boolean directoryExcluded = false;
147147
Boolean exclude = false;
148148
if(exclusionRules.size() == 0 && inclusionRules.size() == 0) {

0 commit comments

Comments
 (0)