Read an undefined tagId as absent
Mirror / push (push) Has been cancelled
Test / lint (pull_request) Successful in 31s
Test / test (18) (pull_request) Successful in 30s
Test / test (20) (pull_request) Successful in 30s
Test / test (22) (pull_request) Successful in 30s
Test / test (26) (pull_request) Successful in 31s
Test / test (24) (pull_request) Successful in 36s

This commit is contained in:
2026-09-27 15:31:21 +02:00
parent cda8e9b112
commit 9379212c68
2 changed files with 6 additions and 4 deletions
+2 -2
View File
@@ -166,8 +166,8 @@ function entryOf(name: string, input: unknown): Result<{ tagId: number; tagValue
if (keyed.err) return { err: keyed.err };
if ('tagId' in input && input.tagId !== keyed.tagId) {
return { err: new Error(`TLV "${name}": tagId ${String(input.tagId)} is not the tag its key names, ${String(keyed.tagId)}; drop the tagId`) };
if ('tagId' in input && input.tagId !== undefined && input.tagId !== keyed.tagId) {
return { err: new Error(`TLV "${name}": its tagId is not ${String(keyed.tagId)}, the tag its key names; drop the tagId`) };
}
return { tagId: keyed.tagId, tagValue: input.tagValue };