From 50cbe810f5815403fed66c854a0c12d32b139af2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Mon, 24 Nov 2014 22:06:30 +0100 Subject: [PATCH] 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 --- effects/kscreen/kscreen.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/effects/kscreen/kscreen.cpp b/effects/kscreen/kscreen.cpp index af9a881975..ab13f46514 100644 --- a/effects/kscreen/kscreen.cpp +++ b/effects/kscreen/kscreen.cpp @@ -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(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();