summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSami Merila <sami.merila@nokia.com>2010-02-25 15:06:32 (GMT)
committerSami Merila <sami.merila@nokia.com>2010-02-25 15:06:32 (GMT)
commitd996f6707a8733a8d151dcad59981cbb0f2f03f1 (patch)
tree35b9cfc59f6fcb53c9f2c4fe63c57be8a269e77a /src
parent145f46347bdcdf0efe2821b8ae2c34f53c543d1c (diff)
downloadQt-d996f6707a8733a8d151dcad59981cbb0f2f03f1.zip
Qt-d996f6707a8733a8d151dcad59981cbb0f2f03f1.tar.gz
Qt-d996f6707a8733a8d151dcad59981cbb0f2f03f1.tar.bz2
Crash in QGraphicsScenePrivate::setFocusItemHelper
QGraphicsScenePrivate::setFocusItemHelper accesses views.at(i)->inputContext() without checking if it is null. This leads to a crash if it really is null. Fixed by adding a null pointer check. Task-number: QT-3008 Reviewed-by: axis
Diffstat (limited to 'src')
-rw-r--r--src/gui/graphicsview/qgraphicsscene.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp
index 4472272..1cd1dba 100644
--- a/src/gui/graphicsview/qgraphicsscene.cpp
+++ b/src/gui/graphicsview/qgraphicsscene.cpp
@@ -801,7 +801,8 @@ void QGraphicsScenePrivate::setFocusItemHelper(QGraphicsItem *item,
// do it ourselves.
if (item) {
for (int i = 0; i < views.size(); ++i)
- views.at(i)->inputContext()->reset();
+ if (views.at(i)->inputContext())
+ views.at(i)->inputContext()->reset();
}
}
#endif //QT_NO_IM