Skip to content

Commit fc9351f

Browse files
committed
Don't log error when activing bound cleric impetus with owner offline
1 parent 87f2df4 commit fc9351f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Common/src/main/java/at/petrak/hexcasting/common/blocks/circles/impetuses/BlockEntityRedstoneImpetus.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,11 @@ public ServerPlayer getStoredPlayer() {
8888
if (e instanceof ServerPlayer player) {
8989
return player;
9090
} else {
91-
HexAPI.LOGGER.error("Entity {} stored in a cleric impetus wasn't a player somehow", e);
91+
// if owner is offline then getEntity will return null
92+
// if e is somehow neither null nor a player, something is very wrong
93+
if (e != null) {
94+
HexAPI.LOGGER.error("Entity {} stored in a cleric impetus wasn't a player somehow", e);
95+
}
9296
return null;
9397
}
9498
}

0 commit comments

Comments
 (0)