git://git.nikiroo.be
/
nikiroo-utils.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
update e621 (site changed + move to not deprecated BasicSupport
[nikiroo-utils.git]
/
src
/
jexer
/
bits
/
StringUtils.java
diff --git
a/src/jexer/bits/StringUtils.java
b/src/jexer/bits/StringUtils.java
index 36f7b4e9b28e79e9c6175ded59bbb697b981c44d..d33f71f4e0031710e52ed008fefa0f37f28883c4 100644
(file)
--- 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) {
* @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);
int n = 0;
for (int i = 0; i < str.length();) {
int ch = str.codePointAt(i);