mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2025-01-22 08:01:24 +01:00
Add some NPE protection for variable substitutions
This commit is contained in:
parent
a90a00b09b
commit
5c2166fc93
@ -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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user