Checking whether the m_textTexture is not null before dereferencing it
ClosedPublic

Authored by ivan on Apr 7 2016, 6:03 PM.

Details

Summary

It can be null even after updateTextTexture() if there is not text
to generate the texture from:

if (m_effectFrame->text().isEmpty())
    return;

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 3198.Apr 7 2016, 6:03 PM
ivan retitled this revision from to Checking whether the m_textTexture is not null before dereferencing it.
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, 6:03 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
graesslin accepted this revision.Apr 8 2016, 6:01 AM
graesslin edited edge metadata.

Interestingly we have never seen this one being a problem over the last few years, so in reality the text never is empty.

This revision is now accepted and ready to land.Apr 8 2016, 6:01 AM
ivan added a comment.Apr 8 2016, 7:21 AM

That is what static analysis is for - to catch bugs that have not been exposed yet :)

This revision was automatically updated to reflect the committed changes.