kdevdesigner: prevent SEGV from invalid pointer. This relates to issue TDE/tqt3#97

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/35/head
Michele Calgaro 5 months ago
parent 0ac52a652e
commit 30ac86e18c
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -1220,7 +1220,10 @@ void Resource::saveItems( TQObject *obj, TQTextStream &ts, int indent )
indent--;
ts << makeIndent( indent ) << "</column>" << endl;
}
saveItem( lv->firstChild(), ts, indent - 1 );
if (lv->firstChild())
{
saveItem( lv->firstChild(), ts, indent - 1 );
}
}
#if !defined (TQT_NO_TABLE)
else if ( ::tqt_cast<TQTable*>(obj) ) {
@ -1280,6 +1283,10 @@ void Resource::saveItems( TQObject *obj, TQTextStream &ts, int indent )
void Resource::saveItem( TQListViewItem *i, TQTextStream &ts, int indent )
{
if (!i)
{
return;
}
TQListView *lv = i->listView();
while ( i ) {
ts << makeIndent( indent ) << "<item>" << endl;

Loading…
Cancel
Save