Skip to content

Commit

Permalink
add an extra null check to entitytag.owner
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Oct 4, 2021
1 parent c36332a commit 5e42b3e
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -92,7 +92,11 @@ public ObjectTag getObjectAttribute(Attribute attribute) {
// -->
if (attribute.startsWith("owner") || attribute.startsWith("get_owner")) {
if (((Tameable) entity.getBukkitEntity()).isTamed()) {
return new PlayerTag((OfflinePlayer) ((Tameable) entity.getBukkitEntity()).getOwner())
OfflinePlayer tamer = (OfflinePlayer) ((Tameable) entity.getBukkitEntity()).getOwner();
if (tamer == null) {
return null;
}
return new PlayerTag(tamer)
.getObjectAttribute(attribute.fulfill(1));
}
else {
Expand Down

0 comments on commit 5e42b3e

Please sign in to comment.