mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-15 18:25:24 +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;
|
* 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 pathName
|
||||||
* @param buffer
|
* @param buffer
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public addBuffer(pathName: string, buffer: Buffer): void {
|
public addBuffer(pathName: string, buffer: Buffer): void {
|
||||||
/**
|
if (!buffer) {
|
||||||
* @TODO implement
|
return;
|
||||||
* @TODO exclude pass.json, manifest, signature files
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
if (/manifest|signature/.test(pathName)) {
|
if (/manifest|signature/.test(pathName)) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user