Skip to content

Commit

Permalink
Merge pull request #390 from nada-ben-ali/NaBe/small_fix
Browse files Browse the repository at this point in the history
Small fix
  • Loading branch information
nada-ben-ali authored Feb 20, 2025
2 parents 90b8b96 + da66ea8 commit a2bff12
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions odxtools/dataobjectproperty.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ def decode_from_pdu(self, decode_state: DecodeState) -> ParameterValue:
internal_to_phys = self.compu_method.compu_internal_to_phys
default_value = internal_to_phys.compu_default_value if internal_to_phys else None

if default_value is not None:
return str(default_value)
if default_value and default_value.value is not None:
return default_value.value

odxraise(f"DOP {self.short_name} could not convert the coded value "
f"{repr(internal)} to physical type {self.physical_type.base_data_type}.")
Expand Down

0 comments on commit a2bff12

Please sign in to comment.