diff options
author | Viktor Engelmann <viktor.engelmann@qt.io> | 2017-04-06 15:19:24 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-04-15 14:14:30 +0000 |
commit | f88200c6b44a5e68f7d9fabde9ac58c86728acb4 (patch) | |
tree | 300703b03f64c1010a41ed837c213359038755f2 /src/core/web_contents_view_qt.cpp | |
parent | fa94cb09e095a6d6c5634ae8543fc70145594c05 (diff) |
Add two nullpointer checks
The two nullpointer checks prevent crashes that happened when one
clicked on a link with target="_blank" in 56-based.
Task-number: QTBUG-46713
Change-Id: I1f8a20a52726ab05a85dbca2ec49784985384d06
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/core/web_contents_view_qt.cpp')
-rw-r--r-- | src/core/web_contents_view_qt.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core/web_contents_view_qt.cpp b/src/core/web_contents_view_qt.cpp index 4f921bd07..844544887 100644 --- a/src/core/web_contents_view_qt.cpp +++ b/src/core/web_contents_view_qt.cpp @@ -118,8 +118,10 @@ gfx::NativeView WebContentsViewQt::GetNativeView() const void WebContentsViewQt::GetContainerBounds(gfx::Rect* out) const { - const QRectF r(m_client->viewportRect()); - *out = gfx::Rect(r.x(), r.y(), r.width(), r.height()); + if (m_client) { + const QRectF r(m_client->viewportRect()); + *out = gfx::Rect(r.x(), r.y(), r.width(), r.height()); + } } void WebContentsViewQt::Focus() |