Small improvement

pull/162/head
M66B 6 years ago
parent 930921f500
commit 264b957c73

@ -69,13 +69,17 @@ public class EntityAnswer implements Serializable {
if (fullName != null) {
fullName = fullName.trim();
int c = fullName.lastIndexOf(",");
if (c < 0)
if (c > 0) {
last = fullName.substring(0, c).trim();
first = fullName.substring(c + 1).trim();
} else {
c = fullName.lastIndexOf(" ");
if (c > 0) {
first = fullName.substring(0, c).trim();
last = fullName.substring(c + 1).trim();
}
}
}
text = text.replace("$name$", fullName == null ? "" : fullName);
text = text.replace("$firstname$", first == null ? "" : first);

Loading…
Cancel
Save