From 12e2686e3f7b03059c91c5bcfc76796f0ce4e6cb Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Mon, 1 Feb 2021 19:57:22 -0500 Subject: [PATCH] fix: always report resource --- plugins/common/properties.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plugins/common/properties.go b/plugins/common/properties.go index 7cacffb18..0fc20a38a 100644 --- a/plugins/common/properties.go +++ b/plugins/common/properties.go @@ -106,6 +106,16 @@ func PropertyGet(pluginName string, appName string, property string) string { func PropertyGetAll(pluginName string, appName string) (map[string]string, error) { properties := make(map[string]string) pluginAppConfigRoot := getPluginAppPropertyPath(pluginName, appName) + + fi, err := os.Stat(pluginAppConfigRoot) + if err != nil { + return properties, nil + } + + if !fi.IsDir() { + return properties, errors.New("Specified property path is not a directory") + } + files, err := ioutil.ReadDir(pluginAppConfigRoot) if err != nil { return properties, err