diff options
| author | Jabier Arraiza <jabier.arraiza@marker.es> | 2019-01-18 14:36:23 +0000 |
|---|---|---|
| committer | Jabier Arraiza <jabier.arraiza@marker.es> | 2019-01-18 14:36:23 +0000 |
| commit | fb056f1dc348c36502bfd91c8e9ebc42c1488300 (patch) | |
| tree | f609afdd4fa2985e07636e2610431d3e48ff23aa /src/ui/dialog/objects.cpp | |
| parent | Remove crashes when using attributes XML dialog (diff) | |
| download | inkscape-fb056f1dc348c36502bfd91c8e9ebc42c1488300.tar.gz inkscape-fb056f1dc348c36502bfd91c8e9ebc42c1488300.zip | |
Remove crashes when using attributes XML dialog with Objects dialog open (II)
Diffstat (limited to 'src/ui/dialog/objects.cpp')
| -rw-r--r-- | src/ui/dialog/objects.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
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; |
