Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-2527

NPE in java.util.regex.Matcher when getActionUrl returns null

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • plugin-proposals
    • None
    • Platform: All, OS: All

      My plugin component implementing hudson.model.Action returns null in the hope of
      not being displayed in the menu. This results in a NPE. I'm pasting the first
      lines of the exception and if I can find an upload box I'll give the full
      stacktrace.

      java.lang.NullPointerException
      at java.util.regex.Matcher.getTextLength(Matcher.java:1140)
      at java.util.regex.Matcher.reset(Matcher.java:291)
      at java.util.regex.Matcher.<init>(Matcher.java:211)
      at java.util.regex.Pattern.matcher(Pattern.java:888)
      at hudson.Functions.getActionUrl(Functions.java:870)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at
      sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)

          [JENKINS-2527] NPE in java.util.regex.Matcher when getActionUrl returns null

          toomasr added a comment -

          Created an attachment (id=417)
          Full stacktrace

          toomasr added a comment - Created an attachment (id=417) Full stacktrace

          Code changed in hudson
          User: : kohsuke
          Path:
          trunk/hudson/main/core/src/main/java/hudson/Functions.java
          trunk/hudson/main/core/src/main/java/hudson/model/Action.java
          trunk/www/changelog.html
          http://fisheye4.cenqua.com/changelog/hudson/?cs=12850
          Log:
          [FIXED JENKINS-2527] Fixed NPE and instead deal with this gracefully.
          Improved doc to call out for this error-prone definition of semantics.

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : kohsuke Path: trunk/hudson/main/core/src/main/java/hudson/Functions.java trunk/hudson/main/core/src/main/java/hudson/model/Action.java trunk/www/changelog.html http://fisheye4.cenqua.com/changelog/hudson/?cs=12850 Log: [FIXED JENKINS-2527] Fixed NPE and instead deal with this gracefully. Improved doc to call out for this error-prone definition of semantics.

            Unassigned Unassigned
            toomasr toomasr
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: