prevent from segf when no button on scene

This commit is contained in:
arthur.jamet
2021-06-08 12:43:18 +02:00
parent b2789809bf
commit b21621375c
2 changed files with 3 additions and 1 deletions

View File

@@ -45,6 +45,8 @@ namespace BBM
currentButton = nullptr;
if (currentButton == nullptr && buttons.size())
currentButton = &(**buttons.begin());
if (!currentButton)
return;
this->updateCurrentButton();
for (auto &[buttonEntity, clickComponent]: buttons) {
if (buttonEntity == *currentButton) {