瀏覽代碼

Merged in Dmitriy-Klabukov/fix-for-exception-while-merging-excellon-1608664398630 (pull request #330)

Fix for exception while merging excellons if there is no slots in second one
Dmitriy Klabukov 5 年之前
父節點
當前提交
8f88fb2749
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      appObjects/FlatCAMExcellon.py

+ 2 - 1
appObjects/FlatCAMExcellon.py

@@ -1313,7 +1313,8 @@ class ExcellonObject(FlatCAMObj, Excellon):
                             break
                             break
                     if t:
                     if t:
                         fused_tools_dict[t]['drills'] += tool_dict['drills']
                         fused_tools_dict[t]['drills'] += tool_dict['drills']
-                        fused_tools_dict[t]['slots'] += tool_dict['slots']
+                        if 'slots' in tool_dict and tool_dict['slots']:
+                                fused_tools_dict[t]['slots'] += tool_dict['slots']
                         fused_tools_dict[t]['solid_geometry'] += tool_dict['solid_geometry']
                         fused_tools_dict[t]['solid_geometry'] += tool_dict['solid_geometry']
                 else:
                 else:
                     fused_tools_dict[toolid] = tool_dict
                     fused_tools_dict[toolid] = tool_dict