We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f83bd51 commit 5a882fbCopy full SHA for 5a882fb
src/legacy/api/ItemAPI.cpp
@@ -224,7 +224,9 @@ Local<Value> ItemClass::isDamaged() {
224
225
Local<Value> ItemClass::isEnchanted() {
226
try {
227
- return Boolean::newBoolean(get()->mUserData->contains(ItemStackBase::TAG_ENCHANTS(), Tag::List));
+ return Boolean::newBoolean(
228
+ get()->mUserData && get()->mUserData->contains(ItemStackBase::TAG_ENCHANTS(), Tag::List)
229
+ );
230
}
231
CATCH("Fail in isEnchanted!");
232
@@ -312,7 +314,6 @@ Local<Value> ItemClass::isStackable() {
312
314
if (get()->getMaxStackSize() > 1u && get()->getDamageValue() <= 0) {
313
315
return Boolean::newBoolean(true);
316
-
317
return Boolean::newBoolean(false);
318
319
CATCH("Fail in isStackable!");
0 commit comments