[ https://issues.jenkins-ci.org/browse/JENKINS-9116?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=160430#comment-160430 ]
evernat commented on JENKINS-9116: ---------------------------------- @pgweiss it seems that you have committed that change so this issue is probably fixed: https://github.com/jenkinsci/description-setter-plugin/commit/8c19a4d8a8775303d6a7c30cf07282b40fc34c5e and it was released in the plugin v1.8 > Doesn't handle group matches that are null > ------------------------------------------ > > Key: JENKINS-9116 > URL: https://issues.jenkins-ci.org/browse/JENKINS-9116 > Project: Jenkins > Issue Type: Bug > Components: description-setter > Reporter: pgweiss > Assignee: huybrechts > > If my regex is: > ^URL: (\S)+( .*)?$ > And my replacement text is: > <a href="\1">My URL\2</a> > It is possible that the regex can succeed and the matcher.group(2) will be > null. If that happens the description setter fails like this: > ERROR: Publisher hudson.plugins.descriptionsetter.DescriptionSetterPublisher > aborted due to exception > java.lang.NullPointerException > at java.lang.String.replace(String.java:2208) > at > hudson.plugins.descriptionsetter.DescriptionSetterPublisher.getExpandedDescription(DescriptionSetterPublisher.java:158) > at > hudson.plugins.descriptionsetter.DescriptionSetterPublisher.perform(DescriptionSetterPublisher.java:80) > at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19) > at > hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:644) > at > hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:623) > at > hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:601) > at hudson.model.Build$RunnerImpl.post2(Build.java:159) > at > hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:570) > at hudson.model.Run.run(Run.java:1386) > at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) > at hudson.model.ResourceController.execute(ResourceController.java:88) > at hudson.model.Executor.run(Executor.java:145) > This can probably be fixed by changing: > result = result.replace("\\" + i, matcher.group(i)) > to > result = result.replace("\\" + i, matcher.group(i) == null ? '' : > matcher.group(i)) > But I haven't actually checked it. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jenkins-ci.org/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira