From fb056f1dc348c36502bfd91c8e9ebc42c1488300 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Date: Fri, 18 Jan 2019 15:36:23 +0100 Subject: Remove crashes when using attributes XML dialog with Objects dialog open (II) --- src/ui/dialog/objects.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/ui/dialog/objects.cpp') diff --git a/src/ui/dialog/objects.cpp b/src/ui/dialog/objects.cpp index 9e115a2d6..f02df8042 100644 --- a/src/ui/dialog/objects.cpp +++ b/src/ui/dialog/objects.cpp @@ -422,13 +422,16 @@ void ObjectsPanel::_updateObject( SPObject *obj, bool recurse ) { bool ObjectsPanel::_checkForUpdated(const Gtk::TreeIter& iter, SPObject* obj) { Gtk::TreeModel::Row row = *iter; - if ( obj == row[_model->_colObject] ) + if (obj && *iter && obj == row[_model->_colObject] ) { //We found our item in the tree!! Update it! SPItem * item = SP_IS_ITEM(obj) ? SP_ITEM(obj) : nullptr; SPGroup * group = SP_IS_GROUP(obj) ? SP_GROUP(obj) : nullptr; - - row[_model->_colLabel] = obj->label() ? obj->label() : obj->getId(); + gchar const * id = obj->getId(); + if (!id) { + id = _("no-id"); + } + row[_model->_colLabel] = obj->label() ? obj->label() : id; row[_model->_colVisible] = item ? !item->isHidden() : false; row[_model->_colLocked] = item ? !item->isSensitive() : false; row[_model->_colType] = group ? (group->layerMode() == SPGroup::LAYER ? 2 : 1) : 0; -- cgit v1.2.3