Skip to content

Commit d54e55c

Browse files
authored
(fix) StickyHeaderTableView: crash on certains starting (#1047)
GH-935
1 parent df841e1 commit d54e55c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

android_app/app/src/main/java/com/health/openscale/gui/table/StickyHeaderTableView.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,8 @@ private void updateMaxWidthHeightOfCell() {
608608
if (str.indexOf("\n") != -1) {
609609
String[] split = str.split("\n");
610610

611-
if (split[0].length() >= split[1].length()) {
611+
// split.length == 1 handle the case when str has only 1 \n and it is at the end.
612+
if (split.length == 1 || split[0].length() >= split[1].length()) {
612613
str = split[0];
613614
} else {
614615
str = split[1];

0 commit comments

Comments
 (0)