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
This commit is contained in:
parent
d31e9e88b4
commit
2c95a4e6b9
1 changed files with 4 additions and 0 deletions
|
@ -365,6 +365,10 @@ bool Shadow::updateShadow()
|
|||
}
|
||||
}
|
||||
}
|
||||
if (!m_topLevel) {
|
||||
clear();
|
||||
return false;
|
||||
}
|
||||
auto data = Shadow::readX11ShadowProperty(m_topLevel->window());
|
||||
if (data.isEmpty()) {
|
||||
clear();
|
||||
|
|
Loading…
Reference in a new issue