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

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit 30ac86e18c)
r14.1.x
Michele Calgaro 11 months ago
parent ea8f1be465
commit f12db681be
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