From 1fd169c6697f268588733e7a6d65e80d587b51ab Mon Sep 17 00:00:00 2001 From: Thomas Karl Pietrowski Date: Thu, 22 Sep 2016 11:43:21 +0200 Subject: [PATCH] SliceInfo: Defining container_serialized as empty, before trying to serialize While discussing with Jordy about the code I just found a problematic case where sending slice info could fail. (This shouldn't happen, but..) If the first container is not serializable, then the for-loop will crash because container_serialized is not set for the if clause. Additionally the if-clause is at the moment useless, because it is always true, because the content of container_serialized gets never resetted. Contributes to CURA-1445 --- plugins/SliceInfoPlugin/SliceInfo.py | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/SliceInfoPlugin/SliceInfo.py b/plugins/SliceInfoPlugin/SliceInfo.py index 78cb099d64..4d54a7c39b 100644 --- a/plugins/SliceInfoPlugin/SliceInfo.py +++ b/plugins/SliceInfoPlugin/SliceInfo.py @@ -119,6 +119,7 @@ class SliceInfo(Extension): } for container in global_container_stack.getContainers(): container_id = container.getId() + container_serialized = "" try: container_serialized = container.serialize() except NotImplementedError: