Skip to content

Commit

Permalink
Fix null item handling in toNotch (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
extremeheat committed Jul 22, 2023
1 parent 61c1993 commit 0fd5781
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Expand Up @@ -68,7 +68,7 @@ function loader (registryOrVersion) {
}

static toNotch (item, serverAuthoritative = true) {
const hasNBT = item.nbt && Object.keys(item.nbt.value).length > 0
const hasNBT = item && item.nbt && Object.keys(item.nbt.value).length > 0

if (registry.type === 'pc') {
if (registry.supportFeature('itemSerializationAllowsPresent')) {
Expand Down

0 comments on commit 0fd5781

Please sign in to comment.