[Cards] Guard against null QScreen when positioning enlarged pixmap (#7650)

Co-authored-by: sentry[bot] <39604003+sentry[bot]@users.noreply.github.com>
This commit is contained in:
sentry[bot]
2026-10-25 17:35:10 +01:00
committed by GitHub
parent 93309e01a2
commit f3fb3331d1

View File

@@ -491,7 +491,14 @@ void CardInfoPictureWidget::showEnlargedPixmap()
enlargedPixmapWidget->setCardPixmap(exactCard, enlargedSize);
const QPoint cursorPos = QCursor::pos();
const QRect screenGeometry = QGuiApplication::screenAt(cursorPos)->geometry();
QScreen *screen = QGuiApplication::screenAt(cursorPos);
if (!screen) {
screen = QGuiApplication::primaryScreen();
}
if (!screen) {
return;
}
const QRect screenGeometry = screen->geometry();
const QSize widgetSize = enlargedPixmapWidget->size();
int newX = cursorPos.x() + ENLARGED_PIXMAP_OFFSET;