X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2Fbits%2FStringUtils.java;h=d33f71f4e0031710e52ed008fefa0f37f28883c4;hb=4941d2d6184cb5d59c2932411a40631db8b429d1;hp=36f7b4e9b28e79e9c6175ded59bbb697b981c44d;hpb=6cd9e129296133418d01b82cd5082e863f5ee490;p=fanfix.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);