mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-15 16:25:21 +00:00
Added check to prevent the addition of empty undefined / null as buffers
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user