Updated Branches: refs/heads/sqoop2 b1fcbc9d9 -> c452ffcaa
SQOOP-1040: Sqoop2: NPE in TableDisplayer (Jarek Jarcec Cecho via Kate Ting) Project: http://git-wip-us.apache.org/repos/asf/sqoop/repo Commit: http://git-wip-us.apache.org/repos/asf/sqoop/commit/c452ffca Tree: http://git-wip-us.apache.org/repos/asf/sqoop/tree/c452ffca Diff: http://git-wip-us.apache.org/repos/asf/sqoop/diff/c452ffca Branch: refs/heads/sqoop2 Commit: c452ffcaacb17d50a558925eb408417894844195 Parents: b1fcbc9 Author: Kate Ting <[email protected]> Authored: Sun May 12 20:36:11 2013 -0400 Committer: Kate Ting <[email protected]> Committed: Sun May 12 20:36:11 2013 -0400 ---------------------------------------------------------------------- .../apache/sqoop/client/utils/TableDisplayer.java | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/sqoop/blob/c452ffca/client/src/main/java/org/apache/sqoop/client/utils/TableDisplayer.java ---------------------------------------------------------------------- diff --git a/client/src/main/java/org/apache/sqoop/client/utils/TableDisplayer.java b/client/src/main/java/org/apache/sqoop/client/utils/TableDisplayer.java index 79ea96f..487fa50 100644 --- a/client/src/main/java/org/apache/sqoop/client/utils/TableDisplayer.java +++ b/client/src/main/java/org/apache/sqoop/client/utils/TableDisplayer.java @@ -103,10 +103,13 @@ public class TableDisplayer { * @return Maximal */ private static int getMaximalWidth(String header, List<String> column) { + assert header != null; + assert column != null; + int max = header.length(); for(String value : column) { - if(value.length() > max) { + if(value != null && value.length() > max) { max = value.length(); } }
