summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gerbonara/cad/kicad/footprints.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/gerbonara/cad/kicad/footprints.py b/gerbonara/cad/kicad/footprints.py
index 82c0d62..9772b55 100644
--- a/gerbonara/cad/kicad/footprints.py
+++ b/gerbonara/cad/kicad/footprints.py
@@ -616,9 +616,14 @@ class Footprint:
pad.footprint = self
def property_value(self, key, default=_MISSING):
- if default is not _MISSING and key not in self.properties:
+ for prop in self.properties:
+ if prop.key == key:
+ return prop.value
+
+ if default is not _MISSING:
return default
- return self.properties[key].value
+
+ raise IndexError(f'Footprint has no property named "{key}"')
@property
def pads_by_number(self):