Skip to content

Commit

Permalink
fix ban info stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Jul 5, 2016
1 parent a3d7f91 commit 1cb442e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/net/aufdemrand/denizen/objects/dPlayer.java
Expand Up @@ -1276,16 +1276,17 @@ else if (ban.getExpiration() == null) {
if (ban == null) {
return null;
}
else if (ban.getExpiration().before(new Date())) {
else if (ban.getExpiration() != null && ban.getExpiration().before(new Date())) {
return null;
}
// <--[tag]
// @attribute <p@player.ban_info.expiration>
// @returns Duration
// @description
// Returns the expiration of the player's ban, if they are banned.
// Potentially can be null.
// -->
if (attribute.startsWith("expiration")) {
if (attribute.startsWith("expiration") && ban.getExpiration() != null) {
return new Duration(ban.getExpiration().getTime() / 50)
.getAttribute(attribute.fulfill(1));
}
Expand Down

0 comments on commit 1cb442e

Please sign in to comment.