aboutsummaryrefslogtreecommitdiffstats
path: root/src/templates/qquickcombobox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/templates/qquickcombobox.cpp')
-rw-r--r--src/templates/qquickcombobox.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/templates/qquickcombobox.cpp b/src/templates/qquickcombobox.cpp
index 4465d5dc..a2c0bf89 100644
--- a/src/templates/qquickcombobox.cpp
+++ b/src/templates/qquickcombobox.cpp
@@ -595,7 +595,7 @@ void QQuickComboBox::setPopup(QQuickPopup *popup)
QString QQuickComboBox::textAt(int index) const
{
Q_D(const QQuickComboBox);
- if (!d->delegateModel || index < 0 || index >= d->delegateModel->count())
+ if (!d->delegateModel || index < 0 || index >= d->delegateModel->count() || !d->delegateModel->object(index))
return QString();
return d->delegateModel->stringValue(index, d->textRole.isEmpty() ? QStringLiteral("modelData") : d->textRole);
}