don't access array to check whether ptr is nullptr

Also unify with the below check whether array[0] is 0
(Was same condition and same branch)

BUG: 341010
This commit is contained in:
Thomas Lübking 2014-11-24 22:06:30 +01:00
parent 7747a38189
commit 50cbe810f5

View file

@ -123,16 +123,8 @@ void KscreenEffect::propertyNotify(EffectWindow *window, long int atom)
}
QByteArray byteData = effects->readRootProperty(m_atom, XCB_ATOM_CARDINAL, 32);
auto *data = reinterpret_cast<uint32_t *>(byteData.data());
if (!data[0]) {
// Property was deleted
if (m_state != StateNormal) {
m_state = StateNormal;
effects->addRepaintFull();
}
return;
}
if (data[0] == 0) {
// normal state - KWin should have switched to it
if (!data // Property was deleted
|| data[0] == 0) { // normal state - KWin should have switched to it
if (m_state != StateNormal) {
m_state = StateNormal;
effects->addRepaintFull();