diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2023-12-08 13:05:13 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2023-12-08 13:08:43 +0900 |
commit | 30ac86e18cc775007edbbf3cdb816082c172f38c (patch) | |
tree | 3f24878bf63c3bb7a6569334bddbabf6a5f9c008 /kdevdesigner | |
parent | 0ac52a652e631e24ac4989414b2c27b7b55ec239 (diff) | |
download | tdevelop-30ac86e18cc775007edbbf3cdb816082c172f38c.tar.gz tdevelop-30ac86e18cc775007edbbf3cdb816082c172f38c.zip |
kdevdesigner: prevent SEGV from invalid pointer. This relates to issue TDE/tqt3#97
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'kdevdesigner')
-rw-r--r-- | kdevdesigner/designer/resource.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/kdevdesigner/designer/resource.cpp b/kdevdesigner/designer/resource.cpp index 48da59b4..d4099e34 100644 --- a/kdevdesigner/designer/resource.cpp +++ b/kdevdesigner/designer/resource.cpp @@ -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; |