Skip to content

Commit

Permalink
add a range check to EditorUI
Browse files Browse the repository at this point in the history
  • Loading branch information
HJfod committed May 22, 2024
1 parent ae92005 commit 73dd32b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/EditorUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ using namespace geode::node_ids;
if (auto bar = getChildOfType<EditButtonBar>(this, buttonBarIndex++)) {
bar->setID(id);
}
else break;
}

if (auto editBar = static_cast<EditButtonBar*>(this->getChildByID("edit-tab-bar"))) {
Expand Down Expand Up @@ -278,7 +279,9 @@ using namespace geode::node_ids;
};
size_t i = 0;
for (auto id : editButtonIDs) {
static_cast<CCNode*>(editBar->m_buttonArray->objectAtIndex(i++))->setID(id);
if (i < editBar->m_buttonArray->count()) {
static_cast<CCNode*>(editBar->m_buttonArray->objectAtIndex(i++))->setID(id);
}
}
}

Expand Down

0 comments on commit 73dd32b

Please sign in to comment.