Add some NPE protection for variable substitutions

This commit is contained in:
tastybento 2023-06-19 09:37:14 -07:00
parent a90a00b09b
commit 5c2166fc93

View File

@ -472,7 +472,10 @@ public class User implements MetaDataAble {
// Then replace variables
if (variables.length > 1) {
for (int i = 0; i < variables.length; i += 2) {
translation = translation.replace(variables[i], variables[i + 1]);
// Prevent a NPE if the substituting variable is null
if (variables[i + 1] != null) {
translation = translation.replace(variables[i], variables[i + 1]);
}
}
}