diff --git a/core/src/processing/core/PApplet.java b/core/src/processing/core/PApplet.java index 440bfa838..0ba12d8aa 100644 --- a/core/src/processing/core/PApplet.java +++ b/core/src/processing/core/PApplet.java @@ -8673,6 +8673,9 @@ public class PApplet implements PConstants { * @param array a String array */ static public String[] trim(String[] array) { + if (array == null) { + return null; + } String[] outgoing = new String[array.length]; for (int i = 0; i < array.length; i++) { if (array[i] != null) { diff --git a/core/src/processing/data/Table.java b/core/src/processing/data/Table.java index be8defeec..4622d6413 100644 --- a/core/src/processing/data/Table.java +++ b/core/src/processing/data/Table.java @@ -4045,6 +4045,7 @@ public class Table { * @see Table#removeTokens(String) */ public void trim() { + columnTitles = PApplet.trim(columnTitles); for (int col = 0; col < getColumnCount(); col++) { trim(col); } diff --git a/core/todo.txt b/core/todo.txt index c1608243e..eee476aaf 100644 --- a/core/todo.txt +++ b/core/todo.txt @@ -1,4 +1,5 @@ 0257 (3.2.5) +X return null for PApplet.trim(null) X StringDict(TableRow) constructor X allow lone double quotes in the midst of csv strings _ make trim() work on column titles as well