From a2fb80dd0ec286c03d8ceb70d147d0a9653281fd Mon Sep 17 00:00:00 2001 From: Riccardo Iaconelli Date: Sat, 24 May 2008 15:24:30 +0000 Subject: [PATCH] Safety++ Just to be sure, dear Bernhard, please double check that this does really fix the crash for you. =) BUG: 162436 Signed-off-by: Riccardo Iaconelli svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=812085 --- applethandle.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/applethandle.cpp b/applethandle.cpp index ba7b054f8..56f858ee3 100644 --- a/applethandle.cpp +++ b/applethandle.cpp @@ -408,16 +408,18 @@ void AppletHandle::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) QList containments = corona->containments(); for (int i = 0; i < containments.size(); ++i) { QPointF pos; - pos = containments[i]->view()->mapToScene(containments[i]->view() - ->mapFromGlobal(m_screenRect.topLeft())); + if (containments[i]->view()) { + pos = containments[i]->view()->mapToScene(containments[i]->view() + ->mapFromGlobal(m_screenRect.topLeft())); - if (containments[i]->sceneBoundingRect().contains(pos)) { - //kDebug() << "new containment = " << containments[i]; - kDebug() << "rect = " << containments[i]->sceneBoundingRect(); - // add the applet to the new containment and take it from the old one - kDebug() << "moving to other containment with position" << pos;; - switchContainment(containments[i], pos); - break; + if (containments[i]->sceneBoundingRect().contains(pos)) { + //kDebug() << "new containment = " << containments[i]; + kDebug() << "rect = " << containments[i]->sceneBoundingRect(); + // add the applet to the new containment and take it from the old one + kDebug() << "moving to other containment with position" << pos;; + switchContainment(containments[i], pos); + break; + } } } }