Skip to content

Commit

Permalink
fix null handling in server flag tags
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Dec 6, 2020
1 parent b77ce28 commit 7f32551
Showing 1 changed file with 10 additions and 4 deletions.
Expand Up @@ -465,13 +465,19 @@ else if (recipe instanceof CookingRecipe<?>) {
return;
}
if (attribute.startsWith("flag_expiration")) {
event.setReplacedObject(Denizen.getInstance().serverFlagMap.doFlagExpirationTag(attribute)
.getObjectAttribute(attribute.fulfill(1)));
TimeTag exp = Denizen.getInstance().serverFlagMap.doFlagExpirationTag(attribute);
if (exp != null) {
event.setReplacedObject(exp
.getObjectAttribute(attribute.fulfill(1)));
}
return;
}
if (attribute.startsWith("flag")) {
event.setReplacedObject(Denizen.getInstance().serverFlagMap.doFlagTag(attribute)
.getObjectAttribute(attribute.fulfill(1)));
ObjectTag flag = Denizen.getInstance().serverFlagMap.doFlagTag(attribute);
if (flag != null) {
event.setReplacedObject(flag
.getObjectAttribute(attribute.fulfill(1)));
}
return;
}
if (attribute.startsWith("list_flags")) {
Expand Down

0 comments on commit 7f32551

Please sign in to comment.