summaryrefslogtreecommitdiffstats
path: root/kdevdesigner/designer
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2023-12-08 13:05:13 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2023-12-08 16:23:40 +0900
commitf12db681be834f7027132156c05afcbcb2346278 (patch)
tree250a14bbfd24f883df05a7ea385fd82df9aab97c /kdevdesigner/designer
parentea8f1be4653ed9ee5f0e4b26458fd7ce6981c297 (diff)
downloadtdevelop-f12db681be834f7027132156c05afcbcb2346278.tar.gz
tdevelop-f12db681be834f7027132156c05afcbcb2346278.zip
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 30ac86e18cc775007edbbf3cdb816082c172f38c)
Diffstat (limited to 'kdevdesigner/designer')
-rw-r--r--kdevdesigner/designer/resource.cpp9
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;