From d3a681a2792a00c50ed0d7e9195981b9e8238b25 Mon Sep 17 00:00:00 2001 From: mbarto Date: Fri, 25 Nov 2016 09:58:08 +0100 Subject: [PATCH] Fixes #1219: some issues in CSW catalog parsing of WMS services (#1293) --- web/client/utils/CatalogUtils.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/web/client/utils/CatalogUtils.js b/web/client/utils/CatalogUtils.js index 3d083b44e3..e54b267fe9 100644 --- a/web/client/utils/CatalogUtils.js +++ b/web/client/utils/CatalogUtils.js @@ -7,7 +7,7 @@ */ const assign = require('object-assign'); -const {head, isArray} = require('lodash'); +const {head, isArray, isString} = require('lodash'); const urlUtil = require('url'); const getWMSBBox = (record) => { @@ -83,7 +83,7 @@ const converters = { }); } - if (wms) { + if (wms && wms.name) { let absolute = (wms.value.indexOf("http") === 0); if (!absolute) { assign({}, wms, {value: options.catalogURL + "/" + wms.value} ); @@ -108,11 +108,11 @@ const converters = { // setup the final record object return { - title: dc.title, - description: dc.abstract, - identifier: dc.identifier, + title: isString(dc.title) && dc.title || '', + description: isString(dc.abstract) && dc.abstract || '', + identifier: isString(dc.identifier) && dc.identifier || '', thumbnail: thumbURL, - tags: dc.subject, + tags: isString(dc.subject) && dc.subject || '', boundingBox: record.boundingBox, references: references };