Skip to content

Commit 3f81447

Browse files
committed
chore: optimize code
1 parent f49130d commit 3f81447

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/legacy/api/PlayerAPI.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1634,8 +1634,9 @@ Local<Value> PlayerClass::getEnderChest(const Arguments& args) {
16341634
try {
16351635
Player* player = get();
16361636
if (!player) return Local<Value>();
1637-
if (player->getEnderChestContainer().has_value()) {
1638-
return ContainerClass::newContainer(player->getEnderChestContainer());
1637+
auto chest = player->getEnderChestContainer();
1638+
if (chest) {
1639+
return ContainerClass::newContainer(chest);
16391640
} else {
16401641
return {};
16411642
}

0 commit comments

Comments
 (0)