Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-2264

CSVRequestHandler can throw NPE when no escape parameter is specified for splitting

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.4.1
    • Fix Version/s: 1.4.2, 3.1, 4.0-ALPHA
    • Component/s: update
    • Labels:
      None

      Description

      If you specify f.<fieldname>.split=true but don't specify anything else, you get a NPE:

      java.lang.NullPointerException
      at org.apache.solr.handler.CSVLoader.prepareFields(CSVRequestHandler.java:310)
      at org.apache.solr.handler.CSVLoader.<init>(CSVRequestHandler.java:259)
      at org.apache.solr.handler.SingleThreadedCSVLoader.<init>(CSVRequestHandler.java:394)
      at org.apache.solr.handler.CSVRequestHandler.newLoader(CSVRequestHandler.java:46)

      Line 310 in CSVRequestHandler.java has this:

      char fesc = escStr==null || encStr.length()==0 ? CSVStrategy.ESCAPE_DISABLED : escStr.charAt(0);

      Note that "encStr.length()" should be "escStr.length()"

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              kkrugler Kenneth William Krugler
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: