From c4fde5ba0d43482973db964727b9d48a9c2f9f06 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Thu, 16 Jul 2009 12:33:32 +1000 Subject: Fix crash in anchors. --- src/declarative/fx/qfxanchors.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/declarative/fx/qfxanchors.cpp b/src/declarative/fx/qfxanchors.cpp index 22b9b08..3cfa02f 100644 --- a/src/declarative/fx/qfxanchors.cpp +++ b/src/declarative/fx/qfxanchors.cpp @@ -324,6 +324,8 @@ QFxItem *QFxAnchors::fill() const void QFxAnchors::setFill(QFxItem *f) { Q_D(QFxAnchors); + if (!f) + return; if (f != d->item->itemParent() && f->itemParent() != d->item->itemParent()){ qmlInfo(d->item) << "Can't anchor to an item that isn't a parent or sibling."; return; @@ -351,10 +353,8 @@ QFxItem *QFxAnchors::centeredIn() const void QFxAnchors::setCenteredIn(QFxItem* c) { Q_D(QFxAnchors); - if (!c){ - qmlInfo(d->item) << "Cannot center in null item."; + if (!c) return; - } if (c != d->item->itemParent() && c->itemParent() != d->item->itemParent()){ qmlInfo(d->item) << "Can't anchor to an item that isn't a parent or sibling."; return; -- cgit v0.12