We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0c96f70 commit 451dbb1Copy full SHA for 451dbb1
1 file changed
src/engine/engine.cpp
@@ -408,6 +408,9 @@ void Engine::setBroadcasts(const std::vector<std::shared_ptr<Broadcast>> &broadc
408
409
std::shared_ptr<Broadcast> Engine::broadcastAt(int index) const
410
{
411
+ if (index < 0 || index >= m_broadcasts.size())
412
+ return nullptr;
413
+
414
return m_broadcasts[index];
415
}
416
@@ -469,6 +472,9 @@ void Engine::setTargets(const std::vector<std::shared_ptr<Target>> &newTargets)
469
472
470
473
Target *Engine::targetAt(int index) const
471
474
475
+ if (index < 0 || index >= m_targets.size())
476
477
478
return m_targets[index].get();
479
480
0 commit comments