Fix crashes from accessing invalid pointers.
This commit is contained in:
parent
ead3ce8a8a
commit
5f2857f12a
2 changed files with 10 additions and 5 deletions
|
|
@ -47,12 +47,14 @@ void TypeSelectionItemModel::setTypeList(std::shared_ptr<const PgTypeContainer>
|
|||
{
|
||||
beginResetModel();
|
||||
m_types.clear();
|
||||
for (const auto &e : *types) {
|
||||
if (e.category != TypCategory::Array && e.type != "c") {
|
||||
m_types.push_back(e.objectName());
|
||||
if (types) {
|
||||
for (const auto &e : *types) {
|
||||
if (e.category != TypCategory::Array && e.type != "c") {
|
||||
m_types.push_back(e.objectName());
|
||||
}
|
||||
}
|
||||
std::sort(m_types.begin(), m_types.end());
|
||||
}
|
||||
std::sort(m_types.begin(), m_types.end());
|
||||
//emit dataChanged(this->createIndex(0, 0), this->createIndex(types->count(), 0), QVector<int>() << Qt::DisplayRole);
|
||||
endResetModel();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue