Skip to content

Commit c0d6d13

Browse files
committed
fix NPE in fileSet
1 parent d133ac2 commit c0d6d13

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
<artifactId>text-finder</artifactId>
2424
<packaging>hpi</packaging>
25-
<version>1.10.2</version>
25+
<version>1.10.3</version>
2626
<name>Jenkins TextFinder plugin</name>
2727
<url>http://wiki.jenkins-ci.org/display/JENKINS/Text-finder+Plugin</url>
2828

src/main/java/hudson/plugins/textfinder/TextFinderModel.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public final class TextFinderModel extends AbstractDescribableImpl<TextFinderMod
2525

2626
@DataBoundConstructor
2727
public TextFinderModel(String fileSet, String regexp, boolean succeedIfFound, boolean unstableIfFound, boolean alsoCheckConsoleOutput, boolean notBuiltIfFound) {
28-
this.fileSet = Util.fixEmpty(fileSet.trim());
28+
this.fileSet = fileSet != null ? Util.fixEmpty(fileSet.trim()) : null;
2929
this.regexp = regexp;
3030
this.succeedIfFound = succeedIfFound;
3131
this.unstableIfFound = unstableIfFound;

src/main/java/hudson/plugins/textfinder/TextFinderPublisher.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import hudson.Extension;
44
import hudson.FilePath.FileCallable;
55
import hudson.Launcher;
6+
import hudson.Util;
67
import hudson.model.AbstractBuild;
78
import hudson.model.AbstractProject;
89
import hudson.model.BuildListener;
@@ -59,7 +60,7 @@ public TextFinderPublisher(String fileSet, String regexp, boolean succeedIfFound
5960
boolean alsoCheckConsoleOutput, boolean notBuiltIfFound, List<TextFinderModel>
6061
textFinders) {
6162
this.textFinders = textFinders;
62-
this.fileSet = fileSet;
63+
this.fileSet = fileSet != null ? Util.fixEmpty(fileSet.trim()) : null;
6364
this.regexp = regexp;
6465
this.succeedIfFound = succeedIfFound;
6566
this.unstableIfFound = unstableIfFound;

0 commit comments

Comments
 (0)