From b8ddcf90c0341ef9b778f268f5647c1bd5b51b10 Mon Sep 17 00:00:00 2001 From: Caroline Conchon <113697375+carolineconchon@users.noreply.github.com> Date: Mon, 27 Nov 2023 16:59:06 +0100 Subject: [PATCH] Handle error for function getZip Co-authored-by: Caroline Conchon --- es6/tests/utils.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/es6/tests/utils.js b/es6/tests/utils.js index 842f3711..203dc4da 100644 --- a/es6/tests/utils.js +++ b/es6/tests/utils.js @@ -898,6 +898,12 @@ function createDocV4(name, options) { } function getZip(name) { + if ( + documentCache[name] === undefined || + documentCache[name].loadedContent === undefined + ) { + throw new Error("the file examples/" + name + " doesn't exist"); + } return new PizZip(documentCache[name].loadedContent); }