diff --git a/src/lib/download/shared/download.service.ts b/src/lib/download/shared/download.service.ts index ff82c90bc3..097e35247d 100644 --- a/src/lib/download/shared/download.service.ts +++ b/src/lib/download/shared/download.service.ts @@ -25,7 +25,8 @@ export class DownloadService { layer.dataSource.options.download['dynamicUrl'] && layer.dataSource.options.download.url === undefined) { let wfsOptions; - if (Object.keys(layer.dataSource.options['wfsSource']).length > 0) { + if (layer.dataSource.options['wfsSource'] && + Object.keys(layer.dataSource.options['wfsSource']).length > 0) { wfsOptions = layer.dataSource.options['wfsSource']; } else { wfsOptions = layer.dataSource.options;