summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@qt.io>2018-03-15 13:34:16 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2018-03-17 22:53:23 +0000
commitdbbe77e19ca48b6bffe73e0e1a434afe322a22d8 (patch)
tree6a31f319eb86fca955628e40900463e8c4dae529
parent24610724db7918150d07ee7037019ecabe65d160 (diff)
Avoid crash when there is no QScreen attached to the QWindow
Since QWindow::screen() can return 0 we need to account for this instead of assuming that it will always be valid. Task-number: QTBUG-65857 Change-Id: Ifb3a9fdecc76c5c930282101bf383802bf2f2464 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
-rw-r--r--src/core/chromium_overrides.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/chromium_overrides.cpp b/src/core/chromium_overrides.cpp
index 3db107ab1..1bf094a0a 100644
--- a/src/core/chromium_overrides.cpp
+++ b/src/core/chromium_overrides.cpp
@@ -82,7 +82,8 @@ namespace QtWebEngineCore {
void GetScreenInfoFromNativeWindow(QWindow* window, content::ScreenInfo* results)
{
QScreen* screen = window->screen();
-
+ if (!screen)
+ return;
content::ScreenInfo r;
r.device_scale_factor = screen->devicePixelRatio();
r.depth_per_component = 8;