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
This commit is contained in:
Thomas Karl Pietrowski 2016-09-22 11:43:21 +02:00 committed by GitHub
parent fef1cfb5e8
commit 1fd169c669

View File

@ -119,6 +119,7 @@ class SliceInfo(Extension):
} }
for container in global_container_stack.getContainers(): for container in global_container_stack.getContainers():
container_id = container.getId() container_id = container.getId()
container_serialized = ""
try: try:
container_serialized = container.serialize() container_serialized = container.serialize()
except NotImplementedError: except NotImplementedError: