X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2Fbits%2FStringUtils.java;h=d33f71f4e0031710e52ed008fefa0f37f28883c4;hb=c4cefaa04ec122fc02efb6542451a31fdf722c32;hp=36f7b4e9b28e79e9c6175ded59bbb697b981c44d;hpb=54eaded07d2c1c37d9e1000abdcc97be09955867;p=nikiroo-utils.git diff --git a/src/jexer/bits/StringUtils.java b/src/jexer/bits/StringUtils.java index 36f7b4e..d33f71f 100644 --- a/src/jexer/bits/StringUtils.java +++ b/src/jexer/bits/StringUtils.java @@ -472,6 +472,10 @@ public class StringUtils { * @return the number of text cell columns required to display this string */ public static int width(final String str) { + if (str == null) { + return 0; + } + int n = 0; for (int i = 0; i < str.length();) { int ch = str.codePointAt(i);