diff --git a/InteractiveHtmlBom/generate_interactive_bom.py b/InteractiveHtmlBom/generate_interactive_bom.py
index 10001930..9250f1a0 100644
--- a/InteractiveHtmlBom/generate_interactive_bom.py
+++ b/InteractiveHtmlBom/generate_interactive_bom.py
@@ -148,10 +148,13 @@ def parse_draw_segment(d):
else:
print "Polygons not supported for KiCad 4"
polygons = []
+ angle = 0
+ if d.GetParentModule() is not None:
+ angle = d.GetParentModule().GetOrientation() * 0.1,
return {
"type": shape,
"pos": start,
- "angle": d.GetParentModule().GetOrientation() * 0.1,
+ "angle": angle,
"polygons": polygons
}