Fix crash for triggers with no description

This commit is contained in:
tool4EvEr
2021-02-25 22:12:23 +01:00
parent 8ccbffce48
commit c59cd875b8
2 changed files with 3 additions and 3 deletions

View File

@@ -1726,7 +1726,7 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
// for the purpose of pre-ordering, no need for extra granularity
Integer idxAdditionalInfo = firstStr.indexOf(" [");
StringBuilder saLookupKey = new StringBuilder(idxAdditionalInfo != -1 ? firstStr.substring(0, idxAdditionalInfo - 1) : firstStr);
StringBuilder saLookupKey = new StringBuilder(idxAdditionalInfo > 0 ? firstStr.substring(0, idxAdditionalInfo - 1) : firstStr);
char delim = (char) 5;
for (int i = 1; i < activePlayerSAs.size(); i++) {
@@ -1744,7 +1744,7 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
saLookupKey.append(delim).append(saStr);
idxAdditionalInfo = saLookupKey.indexOf(" [");
if (idxAdditionalInfo != -1) {
if (idxAdditionalInfo > 0) {
saLookupKey = new StringBuilder(saLookupKey.substring(0, idxAdditionalInfo - 1));
}
}