SOLR-2264: CSVRequestHandler can throw NPE when no escape parameter is specified for splitting

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1041963 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yonik Seeley 2010-12-03 19:29:30 +00:00
parent 8ec36c3f56
commit 6d4867eca0
1 changed files with 1 additions and 1 deletions

View File

@ -307,7 +307,7 @@ abstract class CSVLoader extends ContentStreamLoader {
String encStr = params.getFieldParam(fname,ENCAPSULATOR); String encStr = params.getFieldParam(fname,ENCAPSULATOR);
char fenc = encStr==null || encStr.length()==0 ? (char)-2 : encStr.charAt(0); char fenc = encStr==null || encStr.length()==0 ? (char)-2 : encStr.charAt(0);
String escStr = params.getFieldParam(fname,ESCAPE); String escStr = params.getFieldParam(fname,ESCAPE);
char fesc = escStr==null || encStr.length()==0 ? CSVStrategy.ESCAPE_DISABLED : escStr.charAt(0); char fesc = escStr==null || escStr.length()==0 ? CSVStrategy.ESCAPE_DISABLED : escStr.charAt(0);
CSVStrategy fstrat = new CSVStrategy(fsep,fenc,CSVStrategy.COMMENTS_DISABLED,fesc, false, false, false, false); CSVStrategy fstrat = new CSVStrategy(fsep,fenc,CSVStrategy.COMMENTS_DISABLED,fesc, false, false, false, false);
adders[i] = new CSVLoader.FieldSplitter(fstrat, adders[i]); adders[i] = new CSVLoader.FieldSplitter(fstrat, adders[i]);