Don't try and trim null strings.
Bug: 21161481
This commit is contained in:
1 parent
a214a63bfe
commit
afa77e947d
1 file changed
+4
@@ -627,6 +627,10 @@ public final class Utilities {
|
||||
* Non-breaking whitespaces are also removed.
|
||||
*/
|
||||
public static String trim(CharSequence s) {
|
||||
if (s == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Just strip any sequence of whitespace or java space characters from the beginning and end
|
||||
Matcher m = sTrimPattern.matcher(s);
|
||||
return m.replaceAll("$1");
|
||||
|
||||
Reference in new issue
Block a user