fix: value length for tagged values

This commit is contained in:
Istvan Ruzman
2020-09-05 16:15:01 +02:00
parent 9dd8a3cb94
commit 7c6e97a9b1

View File

@@ -65,7 +65,6 @@ def decode_attributes(
for key, value, offset in pre_decode_attributes(rad_dict, packet):
attr_def = rad_dict.attrindex.get(key)
length = len(value)
dec_value: Any = value # to silence mypy
tag = 0
if attr_def is None:
@@ -82,6 +81,7 @@ def decode_attributes(
dec_value = attr_def.values[dec_value]
except KeyError:
pass
length = len(value)
attributes.append(
Attribute(
name=name,