From 782e18d09ad2ada6e9cef6db694c81b068a13481 Mon Sep 17 00:00:00 2001 From: Arthur Attwell Date: Mon, 24 Jan 2022 18:20:10 +0200 Subject: [PATCH] Make check for image script more robust --- gulpfile.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index 983a33e6..e77a58aa 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -623,6 +623,7 @@ gulp.task('images:svg', function (done) { // If there is a [book]AllSvg.js function, run it if(imageFunctions.functions + && imageFunctions.functions[book]['all_svg'] && imageFunctions.functions[book]['all_svg']['all_svg']) { console.log('Running the ' + 'all_svg function on ' + filename); imageFunctions.functions[book]['all_svg']['all_svg'](xml) @@ -630,7 +631,8 @@ gulp.task('images:svg', function (done) { // If there is an image-specific function, run it if(imageFunctions.functions - && imageFunctions.functions[book][imageFunctionName]) { + && imageFunctions.functions[book][imageFunctionName] + && imageFunctions.functions[book][imageFunctionName][imageFunctionName]) { console.log('Running the ' + [imageFunctionName] + ' function on ' + filename); imageFunctions.functions[book][imageFunctionName][imageFunctionName](xml) }