From 07b00fabe02e40671930fff9e5a725162754b1c1 Mon Sep 17 00:00:00 2001 From: Chris Palmer Date: Fri, 28 Feb 2020 09:22:50 +0000 Subject: [PATCH] Added a guard against and empty BOM in views.py. --- scripts/views.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/views.py b/scripts/views.py index 02286f3..e14b767 100755 --- a/scripts/views.py +++ b/scripts/views.py @@ -71,9 +71,10 @@ def bom_to_assemblies(bom_dir, bounds_map): # # Remove the main assembly if it is a shell # - ass = flat_bom[-1] - if len(ass["assemblies"]) < 2 and not ass["vitamins"] and not ass["printed"] and not ass["routed"]: - flat_bom = flat_bom[:-1] + if flat_bom: + ass = flat_bom[-1] + if len(ass["assemblies"]) < 2 and not ass["vitamins"] and not ass["printed"] and not ass["routed"]: + flat_bom = flat_bom[:-1] return [assembly["name"] for assembly in flat_bom] def eop(print_mode, doc_file, last = False, first = False):