From 56bb7b9a16abc26f2a8941559590b7507890427a Mon Sep 17 00:00:00 2001 From: Alexander Cerutti Date: Tue, 28 Sep 2021 00:56:30 +0200 Subject: [PATCH] Added check to prevent the addition of empty undefined / null as buffers --- src/PKPass.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/PKPass.ts b/src/PKPass.ts index 9f801d4..c573112 100644 --- a/src/PKPass.ts +++ b/src/PKPass.ts @@ -265,16 +265,17 @@ export default class PKPass extends Bundle { /** * Allows adding a new asset inside the pass / bundle; + * If an empty buffer is passed, it won't be added to + * the bundle. * * @param pathName * @param buffer */ public addBuffer(pathName: string, buffer: Buffer): void { - /** - * @TODO implement - * @TODO exclude pass.json, manifest, signature files - */ + if (!buffer) { + return; + } if (/manifest|signature/.test(pathName)) { return;