From bb10beb1660bcb6e09cc5888c233107fe054ced5 Mon Sep 17 00:00:00 2001
From: Lasse Holmstedt <lasse.holmstedt@nokia.com>
Date: Wed, 28 Jul 2010 15:17:15 +0200
Subject: [PATCH] QML Observer: fix possible crash

---
 src/tools/qml/qmlobserver/editor/crumblepath.cpp | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/tools/qml/qmlobserver/editor/crumblepath.cpp b/src/tools/qml/qmlobserver/editor/crumblepath.cpp
index dc9d2d94230..4fdbfefc49d 100644
--- a/src/tools/qml/qmlobserver/editor/crumblepath.cpp
+++ b/src/tools/qml/qmlobserver/editor/crumblepath.cpp
@@ -181,8 +181,6 @@ void CrumblePath::resizeEvent(QResizeEvent *)
 
 void CrumblePath::resizeButtons()
 {
-    Q_ASSERT(!m_buttons.isEmpty());
-
     int buttonWidth = 0;
     if (m_buttons.length() > 1) {
         QPoint nextElementPosition(0,0);
@@ -202,7 +200,7 @@ void CrumblePath::resizeButtons()
                 button->stackUnder(m_buttons[i - 1]);
         }
 
-    } else {
+    } else if (m_buttons.length() == 1) {
         QWidget *button = m_buttons[0];
         int buttonWidth = 2 * width() / (3 * m_buttons.length());
 
-- 
GitLab