From 8a7b94542f59b955236bbae5faf57e5ce1c7f0e2 Mon Sep 17 00:00:00 2001 From: PaulDalek Date: Tue, 6 Aug 2024 16:42:49 +0200 Subject: [PATCH] The instr and resources.json missing warning log corrections, touch #564. --- CHANGELOG.md | 8 ++++++++ lib/chart.js | 9 ++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9254b1bb..485bbc8e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +# 4.0.3 + +_Fixes:_ + +- Fixed the warning message when the the default `resources.json` file is not found. +- Fixed the problem with the lack of the `instr` value, when the `options` is set instead. +- Corrected the `Node.js Module` example in the README. + # 4.0.2 _Hotfix_: diff --git a/lib/chart.js b/lib/chart.js index 47b28f8d..731d2c7a 100644 --- a/lib/chart.js +++ b/lib/chart.js @@ -97,6 +97,9 @@ export const startExport = async (settings, endCallback) => { try { log(4, '[chart] Attempting to export from a raw input.'); + // Use whichever one is available + exportOptions.instr = exportOptions.instr || exportOptions.options; + // Perform a direct inject when forced if (toBoolean(options.customLogic?.allowCodeExecution)) { return doStraightInject(options, endCallback); @@ -321,11 +324,7 @@ const doExport = async (options, chartJson, endCallback, svg) => { toBoolean(options.customLogic.allowFileResources) ); } catch (error) { - logWithStack( - 2, - error, - `[chart] Unable to load the default resources.json file.` - ); + log(2, `[chart] Unable to load the default resources.json file.`); } } }