Skip to content

Commit 174c361

Browse files
committed
Finally fix Conference to also work with empty images
1 parent ba6800a commit 174c361

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

  • library/src/main/java/com/proxerme/library/connection/messenger/entity

library/src/main/java/com/proxerme/library/connection/messenger/entity/Conference.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,12 @@ public String getImageType() {
123123
if (image.isEmpty()) {
124124
return EMPTY_RESULT;
125125
} else {
126-
String[] split = image.split(IMAGE_DELIMITER);
126+
int delimiterIndex = image.indexOf(IMAGE_DELIMITER);
127127

128-
if (split.length == 2) {
129-
return split[0];
130-
} else {
128+
if (delimiterIndex < 0) {
131129
return EMPTY_RESULT;
130+
} else {
131+
return image.substring(0, delimiterIndex);
132132
}
133133
}
134134
}
@@ -144,12 +144,12 @@ public String getImageId() {
144144
if (image.isEmpty()) {
145145
return EMPTY_RESULT;
146146
} else {
147-
String[] split = image.split(IMAGE_DELIMITER);
147+
int delimiterIndex = image.indexOf(IMAGE_DELIMITER);
148148

149-
if (split.length == 2) {
150-
return split[1];
151-
} else {
149+
if (delimiterIndex < 0) {
152150
return EMPTY_RESULT;
151+
} else {
152+
return image.substring(delimiterIndex);
153153
}
154154
}
155155
}

0 commit comments

Comments
 (0)