From d760ff15d75c211df9316beffa9b9843dbdc12fe Mon Sep 17 00:00:00 2001 From: eblondel Date: Wed, 7 Jul 2021 16:01:08 +0200 Subject: [PATCH] #43 fix findFeatureByName --- R/WMSCapabilities.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/WMSCapabilities.R b/R/WMSCapabilities.R index 36bd073..defbb77 100644 --- a/R/WMSCapabilities.R +++ b/R/WMSCapabilities.R @@ -140,7 +140,7 @@ WMSCapabilities <- R6Class("WMSCapabilities", findLayerByName = function(expr, exact = TRUE){ result <- lapply(private$layers, function(x){ ft <- NULL - if(attr(regexpr(expr, x$getName()), "match.length") != -1 + if(!is.null(x$getName())) if(attr(regexpr(expr, x$getName()), "match.length") != -1 && endsWith(x$getName(), expr)){ ft <- x }