Skip to content

Commit 3e1e6de

Browse files
committed
Fix regression in DBC files with no attribute "BusType"
Fix regression in DBC files with no attribute "BusType"
1 parent e063926 commit 3e1e6de

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/canmatrix/formats/fibex.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -467,8 +467,7 @@ def dump(db, f, **options):
467467
create_sub_element_fx(cluster, "SPEED", "500")
468468
create_sub_element_fx(cluster, "IS-HIGH-LOW-BIT-ORDER", "true")
469469
create_sub_element_fx(cluster, "BIT-COUNTING-POLICY", "MONOTONE")
470-
attribute = db.attributes["BusType"]
471-
if attribute is not None and attribute == "CAN FD":
470+
if "BusType" in db.attributes and db.attributes["BusType"] == "CAN FD":
472471
protocol = create_sub_element_fx(cluster, "PROTOCOL", "CAN-FD")
473472
create_sub_element_fx(cluster, "CAN-FD-SPEED", "2000000")
474473
else:

0 commit comments

Comments
 (0)