From 883fc653045544c724199edfe66e413a94411bcd Mon Sep 17 00:00:00 2001 From: David Huynh Date: Tue, 4 May 2010 16:14:13 +0000 Subject: [PATCH] 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 --- .../metaweb/gridworks/commands/edit/SplitColumnCommand.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/metaweb/gridworks/commands/edit/SplitColumnCommand.java b/src/main/java/com/metaweb/gridworks/commands/edit/SplitColumnCommand.java index a3228e557..dbdadb36a 100644 --- a/src/main/java/com/metaweb/gridworks/commands/edit/SplitColumnCommand.java +++ b/src/main/java/com/metaweb/gridworks/commands/edit/SplitColumnCommand.java @@ -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");