Commit 4e985e36 authored by Christoph Cullmann's avatar Christoph Cullmann 🐮 Committed by Christoph Cullmann
Browse files

handle nullptr return of screenAt()

avoid crash if point is out of range

BUG: 439804


(cherry picked from commit 615c62a7)
parent 6e1f81cc
...@@ -171,7 +171,13 @@ public: ...@@ -171,7 +171,13 @@ public:
void place(QPoint p) void place(QPoint p)
{ {
QRect screen = QApplication::screenAt(p)->availableGeometry(); // try to get right screen, important: QApplication::screenAt(p) might return nullptr
// see crash in bug 439804
const QScreen *screenForTooltip = QApplication::screenAt(p);
if (!screenForTooltip) {
screenForTooltip = screen();
}
const QRect screen = screenForTooltip->availableGeometry();
const auto offset = QPoint(3, 21); const auto offset = QPoint(3, 21);
p += offset; p += offset;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment