mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-10-26 01:20:39 -05:00
[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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user