From 3cfa080cfcdbac65939aec29a267abe3943b6381 Mon Sep 17 00:00:00 2001 From: Linden <65407488+thelindat@users.noreply.github.com> Date: Fri, 11 Feb 2022 05:14:47 +1100 Subject: [PATCH] fix(utils/typeCast): Ensure field.packet is defined Apparently this can be undefined. --- src/utils/typeCast.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/typeCast.ts b/src/utils/typeCast.ts index 6059f92..48029e7 100644 --- a/src/utils/typeCast.ts +++ b/src/utils/typeCast.ts @@ -27,7 +27,7 @@ export const typeCast = (field: Field, next: () => void) => { case 'MEDIUM_BLOB': case 'LONG_BLOB': case 'BLOB': - if (field.packet.charsetNr === 63) { + if (field.packet?.charsetNr === 63) { return [...field.buffer()]; } return field.string();