From: Alan Alpert Date: Fri, 23 Sep 2011 03:24:35 +0000 (+1000) Subject: Defensive Programming X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=704b408da01ac9a85e89a906ee9c6922d7f4323e;p=konrad%2Fqtdeclarative.git Defensive Programming Task-number: QTBUG-21623 Change-Id: Ib906e6b50041d4e72034d6828d4dc7c503ec7bb4 Reviewed-on: http://codereview.qt-project.org/5426 Reviewed-by: Qt Sanity Bot Reviewed-by: Martin Jones --- diff --git a/src/declarative/particles/qsgparticlesystem.cpp b/src/declarative/particles/qsgparticlesystem.cpp index 26c6d05..f886865 100644 --- a/src/declarative/particles/qsgparticlesystem.cpp +++ b/src/declarative/particles/qsgparticlesystem.cpp @@ -938,6 +938,9 @@ void QSGParticleSystem::particleStateChange(int idx) void QSGParticleSystem::moveGroups(QSGParticleData *d, int newGIdx) { + if (!d || newGIdx == d->group) + return; + QSGParticleData* pd = newDatum(newGIdx, false, d->systemIndex); pd->clone(*d); finishNewDatum(pd);