diff --git a/src/declarativeimports/core/datamodel.cpp b/src/declarativeimports/core/datamodel.cpp index 50dc6c5e9..03bea207e 100644 --- a/src/declarativeimports/core/datamodel.cpp +++ b/src/declarativeimports/core/datamodel.cpp @@ -64,7 +64,10 @@ void SortFilterModel::syncRoleNames() QHash SortFilterModel::roleNames() const { - return sourceModel()->roleNames(); + if (sourceModel()) { + return sourceModel()->roleNames(); + } + return {}; } int SortFilterModel::roleNameToId(const QString &name) const