Checking whether m_topLevel is not null before getting its property
ClosedPublic

Authored by ivan on Apr 7 2016, 5:56 PM.

Details

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.

Diff Detail

Repository
R108 KWin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
ivan updated this revision to Diff 3197.Apr 7 2016, 5:56 PM
ivan retitled this revision from to Checking whether m_topLevel is not null before getting its property.
ivan updated this object.
ivan edited the test plan for this revision. (Show Details)
ivan added a reviewer: graesslin.
Restricted Application added a project: Plasma. · View Herald TranscriptApr 7 2016, 5:56 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
graesslin accepted this revision.Apr 8 2016, 5:59 AM
graesslin edited edge metadata.
This revision is now accepted and ready to land.Apr 8 2016, 5:59 AM
This revision was automatically updated to reflect the committed changes.