Do not crash when opening dialogs

This commit is contained in:
Jan Grulich 2018-03-13 11:11:17 +01:00
parent e8014c39d4
commit 13a9a5b837
2 changed files with 21 additions and 1 deletions

View File

@ -3,13 +3,15 @@
Summary: Qt5 - Wayland platform support and QtCompositor module
Name: qt5-%{qt_module}
Version: 5.10.1
Release: 1%{?dist}
Release: 2%{?dist}
License: LGPLv3
Url: http://www.qt.io
Source0: https://download.qt.io/official_releases/qt/5.10/%{version}/submodules/%{qt_module}-everywhere-src-%{version}.tar.xz
# Upstream patches
# https://codereview.qt-project.org/#/c/222139/
Patch0: qtwayland-test-for-null-pointer-before-using-it.patch
# filter qml provides
%global __provides_exclude_from ^%{_qt5_archdatadir}/qml/.*\\.so$
@ -54,6 +56,8 @@ Requires: %{name}%{?_isa} = %{version}-%{release}
%prep
%setup -q -n %{qt_module}-everywhere-src-%{version}
%patch0 -p1 -b .test-for-null-pointer-before-using-it
%build
%{qmake_qt5}
make %{?_smp_mflags}
@ -113,6 +117,9 @@ popd
%changelog
* Tue Mar 13 2018 Jan Grulich <jgrulich@redhat.com> - 5.10.1-2
- Do not crash when opening dialogs
* Wed Feb 14 2018 Jan Grulich <jgrulich@redhat.com> - 5.10.1-1
- 5.10.1

View File

@ -0,0 +1,13 @@
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index 54395a64..edaf2bec 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -801,7 +801,7 @@ static QWaylandWindow *closestShellSurfaceWindow(QWindow *window)
{
while (window) {
auto w = static_cast<QWaylandWindow *>(window->handle());
- if (w->shellSurface())
+ if (w && w->shellSurface())
return w;
window = window->transientParent() ? window->transientParent() : window->parent();
}