core: prevent crash when monitor list is empty (#9572)
This commit is contained in:
parent
c544c5115c
commit
f15b49e0fd
1 changed files with 5 additions and 0 deletions
|
|
@ -815,6 +815,11 @@ PHLMONITOR CCompositor::getMonitorFromCursor() {
|
||||||
}
|
}
|
||||||
|
|
||||||
PHLMONITOR CCompositor::getMonitorFromVector(const Vector2D& point) {
|
PHLMONITOR CCompositor::getMonitorFromVector(const Vector2D& point) {
|
||||||
|
if (m_vMonitors.empty()) {
|
||||||
|
Debug::log(WARN, "getMonitorFromVector called with empty monitor list");
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
PHLMONITOR mon;
|
PHLMONITOR mon;
|
||||||
for (auto const& m : m_vMonitors) {
|
for (auto const& m : m_vMonitors) {
|
||||||
if (CBox{m->vecPosition, m->vecSize}.containsPoint(point)) {
|
if (CBox{m->vecPosition, m->vecSize}.containsPoint(point)) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue