[qet] [4579] Fix crash

[ Thread Index | Date Index | More lists.tuxfamily.org/qet Archives ]


Revision: 4579
Author:   blacksun
Date:     2016-07-17 12:16:37 +0200 (Sun, 17 Jul 2016)
Log Message:
-----------
Fix crash

Modified Paths:
--------------
    trunk/sources/qetgraphicsitem/slaveelement.cpp

Modified: trunk/sources/qetgraphicsitem/slaveelement.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/slaveelement.cpp	2016-07-16 10:19:46 UTC (rev 4578)
+++ trunk/sources/qetgraphicsitem/slaveelement.cpp	2016-07-17 10:16:37 UTC (rev 4579)
@@ -125,9 +125,11 @@
  * the label show the string tagged by "label" of the master
  * and add a qgraphicstextitem for show the position of the master
  */
-void SlaveElement::updateLabel() {
-
-	QString label = this->taggedText("label")->toPlainText();
+void SlaveElement::updateLabel()
+{
+	QString label;
+	if (ElementTextItem *eti = this->taggedText("label"))
+		label = eti->toPlainText();
 	QString Xreflabel;
 	bool no_editable = false;
 


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/