From f3fb3331d141da686da07a3dd560b2391293acb1 Mon Sep 17 00:00:00 2001 From: "sentry[bot]" <39604003+sentry[bot]@users.noreply.github.com> Date: Sun, 25 Oct 2026 17:35:10 +0100 Subject: [PATCH] [Cards] Guard against null QScreen when positioning enlarged pixmap (#7650) Co-authored-by: sentry[bot] <39604003+sentry[bot]@users.noreply.github.com> --- .../interface/widgets/cards/card_info_picture_widget.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cockatrice/src/interface/widgets/cards/card_info_picture_widget.cpp b/cockatrice/src/interface/widgets/cards/card_info_picture_widget.cpp index 3c1e1b77f..0d94e7209 100644 --- a/cockatrice/src/interface/widgets/cards/card_info_picture_widget.cpp +++ b/cockatrice/src/interface/widgets/cards/card_info_picture_widget.cpp @@ -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;