From cc4b62aa09e3906444c48439aa577ffd80c4291e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bl=C3=A4sta=20Johnny?= Date: Wed, 10 Mar 2021 11:48:09 +0100 Subject: [PATCH] Fix for null values for geopackage source --- src/utils/templatehelpers.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/utils/templatehelpers.js b/src/utils/templatehelpers.js index 3681febc2..60944a26a 100644 --- a/src/utils/templatehelpers.js +++ b/src/utils/templatehelpers.js @@ -2,7 +2,13 @@ const templateHelpers = { if: (condition, thenTemplate, elseTemplate = '') => (condition ? thenTemplate : elseTemplate), each: (obj, templateFn) => { const props = Object.keys(obj); - const items = props.map(prop => ({ + const propsIncluded = []; + props.forEach(element => { + if (typeof obj[element] !== 'undefined' && obj[element] !== null && obj[element] !== '') { + propsIncluded.push(element); + } + }); + const items = propsIncluded.map(prop => ({ prop, value: obj[prop] }));