XBEL example: Fix null dereference bug
As readXBEL() does call readSeparator(nullptr), the latter should cope with being passed nullptr as item. Pick-to: 6.6 6.5 Task-number: QTBUG-111228 Change-Id: I786e4438b566438448b5d54ff6442c27f1255aa8 Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
This commit is contained in:
parent
4d8dddd699
commit
705e4e63c6
@ -81,7 +81,7 @@ void XbelReader::readSeparator(QTreeWidgetItem *item)
|
||||
Q_ASSERT(xml.isStartElement() && xml.name() == QLatin1String("separator"));
|
||||
|
||||
QTreeWidgetItem *separator = createChildItem(item);
|
||||
separator->setFlags(item->flags() & ~Qt::ItemIsSelectable);
|
||||
separator->setFlags(item ? item->flags() & ~Qt::ItemIsSelectable : Qt::ItemFlags{});
|
||||
separator->setText(0, QString(30, u'\xB7'));
|
||||
xml.skipCurrentElement();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user