@@ -287,9 +287,11 @@ void ListViewWithPageHeader::setSectionDelegate(QQmlComponent *delegate)
287287 m_sectionDelegate = delegate;
288288
289289 m_topSectionItem = getSectionItem(QString(), false /*watchGeometry*/);
290− m_topSectionItem->setZ(3);
291− QQuickItemPrivate::get(m_topSectionItem)->setCulled(true);
292− connect(m_topSectionItem, &QQuickItem::heightChanged, this, &ListViewWithPageHeader::stickyHeaderHeightChanged);
290+ if (m_topSectionItem) {
291+ m_topSectionItem->setZ(3);
292+ QQuickItemPrivate::get(m_topSectionItem)->setCulled(true);
293+ connect(m_topSectionItem, &QQuickItem::heightChanged, this, &ListViewWithPageHeader::stickyHeaderHeightChanged);
294+ }
293295
294296 // TODO create sections for existing items
295297
@@ -776,7 +778,7 @@ QQuickItem *ListViewWithPageHeader::getSectionItem(const QString §ionText, b
776778 }
777779 m_sectionDelegate->completeCreate();
778780
779− if (watchGeometry) {
781+ if (watchGeometry && sectionItem) {
780782 QQuickItemPrivate::get(sectionItem)->addItemChangeListener(this, QQuickItemPrivate::Geometry);
781783 }
782784