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

scm/SubversionSCM/enterCredential gets NullPointerException if form left blank

    • Icon: Patch Patch
    • Resolution: Fixed
    • Icon: Minor Minor
    • subversion-plugin
    • None
    • Platform: All, OS: All

      Very minor issue, but thought I'd report it..
      Visit the enterCredential page and just click the OK button w/o filling out the
      form.. I get a "server error" page, and webserver log shows
      NullPointerException. 1.262

          [JENKINS-2698] scm/SubversionSCM/enterCredential gets NullPointerException if form left blank

          Alan Harder added a comment -

          Here is a patch to resolve this:

          Index: main/core/src/main/java/hudson/scm/SubversionSCM.java
          ===================================================================
          — main/core/src/main/java/hudson/scm/SubversionSCM.java (revision 13501)
          +++ main/core/src/main/java/hudson/scm/SubversionSCM.java (working copy)
          @@ -1128,7 +1128,7 @@
          // SVNKit wants a key in a file
          final File keyFile;
          FileItem item=null;

          • if(kind.equals("password")) {
            + if(idx <= 1) { keyFile = null; }

            else {
            item =
            parser.getFileItem(kind.equals("publickey")?"privateKey":"certificate");

          Alan Harder added a comment - Here is a patch to resolve this: Index: main/core/src/main/java/hudson/scm/SubversionSCM.java =================================================================== — main/core/src/main/java/hudson/scm/SubversionSCM.java (revision 13501) +++ main/core/src/main/java/hudson/scm/SubversionSCM.java (working copy) @@ -1128,7 +1128,7 @@ // SVNKit wants a key in a file final File keyFile; FileItem item=null; if(kind.equals("password")) { + if(idx <= 1) { keyFile = null; } else { item = parser.getFileItem(kind.equals("publickey")?"privateKey":"certificate");

          Code changed in hudson
          User: : kohsuke
          Path:
          trunk/hudson/main/core/src/main/java/hudson/scm/SubversionSCM.java
          trunk/www/changelog.html
          http://fisheye4.cenqua.com/changelog/hudson/?cs=13649
          Log:
          [FIXED JENKINS-2698] In 1.265.

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : kohsuke Path: trunk/hudson/main/core/src/main/java/hudson/scm/SubversionSCM.java trunk/www/changelog.html http://fisheye4.cenqua.com/changelog/hudson/?cs=13649 Log: [FIXED JENKINS-2698] In 1.265.

            Unassigned Unassigned
            mindless Alan Harder
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: