From 0f57ff8b733e192461af7d143af8b981101ac99a Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Sat, 1 Aug 2020 15:35:12 -0300 Subject: [PATCH] Fixed 'component' column isn't always added, so we must test before remove. --- kiplot/out_bom.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kiplot/out_bom.py b/kiplot/out_bom.py index ed9d8856..4b127056 100644 --- a/kiplot/out_bom.py +++ b/kiplot/out_bom.py @@ -234,7 +234,8 @@ class BoMOptions(BaseOptions): columns.append(new_col) columns_l[new_col.lower()] = new_col # TODO less magic, more explicit - del columns_l['component'] + if 'component' in columns_l: + del columns_l['component'] # Create a list of the columns we don't want self.ignore = [c for c in valid_columns_l.keys() if c not in columns_l] # And this is the ordered list with the case style defined by the user