diff --git a/kicost/distributors/api_element14.py b/kicost/distributors/api_element14.py index 63fe3de6..c966f9d7 100644 --- a/kicost/distributors/api_element14.py +++ b/kicost/distributors/api_element14.py @@ -305,7 +305,9 @@ def _query_part_info(dist, country, parts, distributors, currency): if part.lifecycle is None: part.lifecycle = 'obsolete' if data['productStatus'] == 'NO_LONGER_MANUFACTURED' else 'active' tolerance = footprint = frequency = None - specs = {'rohs': ('RoHS', data['rohsStatusCode'])} + specs = {} + if 'rohsStatusCode' in data: + specs['rohs'] = ('RoHS', data['rohsStatusCode']) for sp in data.get('attributes', []): name = sp['attributeLabel'] name_l = name.lower()