eclipse-symphony / symphony

Symphony project
MIT License
27 stars 17 forks source link

patch stage provider need to block patch if patchSource is catalog but componentName is not specified #109

Closed RemindD closed 3 months ago

RemindD commented 4 months ago

In my understanding, if patchSource is catalog, provider will patch the config in catalog to the component in the solution where componentName matches.

If we call provider with patchSource is catalog but componentName not specified, we will meet cast exception in here. So maybe we'd better have a gateway here to block bad input.

@Haishi2016 Do you think if this is a valid fix?

Haishi2016 commented 4 months ago

There are two ways of patching: 1) to add/remove/replace a component. In this case, componentName is not needed as it will be part of the component spec; 2) to modify specific property of a component.

I agree we need to check for type cast exceptions in general, though.