Blob Blame Raw
From e9dbf63bb62b14d6501eb9853977b60b73a34261 Mon Sep 17 00:00:00 2001
From: Damian Wrobel <dwrobel@ertelnet.rybnik.pl>
Date: Wed, 6 Sep 2017 20:17:43 +0200
Subject: [dxf2gcode PATCH 3/3] Fix AttributeError - object has no attribute
 'update'

Fixes the following crash:

treehandling.py", line 1154, in actionOnSelectionChange
    g.window.canvas_scene.update()
AttributeError: 'NoneType' object has no attribute 'update'
Aborted (core dumped)

Signed-off-by: Damian Wrobel <dwrobel@ertelnet.rybnik.pl>
---
 source/gui/treehandling.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/source/gui/treehandling.py b/source/gui/treehandling.py
index 51126ac..284c38b 100644
--- a/source/gui/treehandling.py
+++ b/source/gui/treehandling.py
@@ -1151,7 +1151,8 @@ class TreeHandler(QWidget):
         selectionEntity = self.ui.entitiesTreeView.selectionModel()
         selectionEntity.select(itemEntitySelection, QItemSelectionModel.Select | QItemSelectionModel.Rows)
 
-        g.window.canvas_scene.update()
+        if g.window.canvas_scene:
+            g.window.canvas_scene.update()
 
     def clearToolsParameters(self):
         """
-- 
2.9.5