powsybl / powsybl-core

A framework to build power system oriented software
https://www.powsybl.org
Mozilla Public License 2.0
124 stars 40 forks source link

Fix exception for connectable not found in Network Modification connection and disconnection #3069

Closed rolnico closed 3 months ago

rolnico commented 3 months ago

Please check if the PR fulfills these requirements

Does this PR already have an issue describing the problem? No

What kind of change does this PR introduce? Bug fix

What is the current behavior? If you use for example a ConnectableConnection on a non-existing connectable or on a TieLine (which is not a Connectable), the application of the NetworkModification will crash due to a null pointer exception

What is the new behavior (if this is a feature change)? You will now get a PowsyblException if you apply with throwException==true or the Network Modification will not be applied and the error will be logged

Does this PR introduce a breaking change or deprecate an API?

rolnico commented 3 months ago

https://github.com/powsybl/powsybl-core/pull/3072 could also be another solution

sonarcloud[bot] commented 3 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
100.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud