Minor bug: blank maxColumns param caused SplitColumnCommand to throw an exception.

git-svn-id: http://google-refine.googlecode.com/svn/trunk@587 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
David Huynh 2010-05-04 16:14:13 +00:00
parent 4eab5a68c8
commit 883fc65304

View File

@ -21,6 +21,8 @@ public class SplitColumnCommand extends EngineDependentCommand {
boolean removeOriginalColumn = Boolean.parseBoolean(request.getParameter("removeOriginalColumn"));
String mode = request.getParameter("mode");
if ("separator".equals(mode)) {
String maxColumns = request.getParameter("maxColumns");
return new ColumnSplitOperation(
engineConfig,
columnName,
@ -28,7 +30,7 @@ public class SplitColumnCommand extends EngineDependentCommand {
removeOriginalColumn,
request.getParameter("separator"),
Boolean.parseBoolean(request.getParameter("regex")),
Integer.parseInt(request.getParameter("maxColumns"))
maxColumns != null && maxColumns.length() > 0 ? Integer.parseInt(maxColumns) : 0
);
} else {
String s = request.getParameter("fieldLengths");