Skip to content

Commit

Permalink
fix: nullpointer in PrepareAnvilEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
Boy0000 committed Dec 29, 2023
1 parent b5a19fc commit 2bf78b0
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class EmojyListener : Listener {
@EventHandler
fun PrepareAnvilEvent.onAnvil() {
val inventory = inventory as? AnvilInventory ?: return
val displayName = (inventory.renameText?.miniMsg() ?: inventory.firstItem?.itemMeta?.displayName())?.transform(inventory.viewers.first() as? Player, false)
val displayName = (inventory.renameText?.miniMsg() ?: inventory.firstItem?.itemMeta?.displayName())?.transform(inventory.viewers.firstOrNull() as? Player, false)
result = result?.editItemMeta {
displayName(displayName)
}
Expand Down

0 comments on commit 2bf78b0

Please sign in to comment.