Git commit 2c95a4e6b9add636bb2398e8656268c399f97f19 by Ivan =C4=8Cuki=C4=87. Committed on 08/04/2016 at 07:25. Pushed by ivan into branch 'master'. Checking whether m_topLevel is not null before getting its property Summary: >From the rest of this method, it is obvious that m_topLevel can be null in any part of the method - we are checking against it being null in a few places in the method - both before and after the affending lines. Now, there is one place where the check is not applied, and potentially calls ->window() on the null pointer. p.s. If there are more places where kwin does clear_or_something(); return; it could benefit from introducing on_scope_exit and similar tricks - see Alexandrescu's 'Declarative control flow' presentation. Reviewers: graesslin Reviewed By: graesslin Subscribers: plasma-devel Projects: #plasma Differential Revision: https://phabricator.kde.org/D1346 M +4 -0 shadow.cpp http://commits.kde.org/kwin/2c95a4e6b9add636bb2398e8656268c399f97f19 diff --git a/shadow.cpp b/shadow.cpp index 65b4080..76792ad 100644 --- a/shadow.cpp +++ b/shadow.cpp @@ -365,6 +365,10 @@ bool Shadow::updateShadow() } } } + if (!m_topLevel) { + clear(); + return false; + } auto data =3D Shadow::readX11ShadowProperty(m_topLevel->window()); if (data.isEmpty()) { clear();