fix: check if the property exists before returning an error
This commit is contained in:
1 parent
a0cb7c560e
commit
aff0c1fc40
1 file changed
+4
@@ -64,6 +64,10 @@ func PropertyClone(pluginName string, oldAppName string, newAppName string) erro
|
|||||||
func PropertyDelete(pluginName string, appName string, property string) error {
|
func PropertyDelete(pluginName string, appName string, property string) error {
|
||||||
propertyPath := getPropertyPath(pluginName, appName, property)
|
propertyPath := getPropertyPath(pluginName, appName, property)
|
||||||
if err := os.Remove(propertyPath); err != nil {
|
if err := os.Remove(propertyPath); err != nil {
|
||||||
|
if !PropertyExists(pluginName, appName, property) {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
return fmt.Errorf("Unable to remove %s property %s.%s", pluginName, appName, property)
|
return fmt.Errorf("Unable to remove %s property %s.%s", pluginName, appName, property)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user