From 75ca49d89aca22fbd5f08c19c67ff7d178cec5e2 Mon Sep 17 00:00:00 2001 From: Alexander Cerutti Date: Sat, 1 Jun 2019 14:01:25 +0200 Subject: [PATCH] Added existence check for readCertificates --- src/factory.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/factory.ts b/src/factory.ts index 06ee3fa..41ed06a 100644 --- a/src/factory.ts +++ b/src/factory.ts @@ -209,7 +209,7 @@ function getModelBufferContents(model: BundleUnit): PartitionedBundle { */ async function readCertificatesFromOptions(options: Certificates): Promise { - if (!isValid(options, "certificatesSchema")) { + if (!(options && Object.keys(options).length && isValid(options, "certificatesSchema"))) { throw new Error("Unable to create Pass: certificates schema validation failed."); }