Skip to content

Commit

Permalink
fixed none error when trying to access the id of an object that does …
Browse files Browse the repository at this point in the history
…not exist
  • Loading branch information
afkiwers committed Feb 2, 2024
1 parent 6a689a7 commit 87c9349
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion inventree_kicad/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,10 @@ def get_footprint(self, part):
footprint_mappings = FootprintParameterMapping.objects.filter(
kicad_category=kicad_category,
)
template_id = kicad_category.footprint_parameter_template.id
template = kicad_category.footprint_parameter_template

if template:
template_id = kicad_category.footprint_parameter_template.id

if not template_id:
template_id = self.plugin.get_setting('KICAD_FOOTPRINT_PARAMETER', None)
Expand Down

0 comments on commit 87c9349

Please sign in to comment.