openbase / bco.dal

Domotic Abstraction Layer
Other
1 stars 2 forks source link

NullPointerException when adding ServiceStateObserver #158

Closed pLeminoq closed 3 years ago

pLeminoq commented 4 years ago

There are currently two issues that can lead to a null pointer exception if a service state observer is added to a unit:

DivineThreepwood commented 4 years ago

Is this always reproducible? Otherwise, can you offer any stack traces?

pLeminoq commented 4 years ago

This is always reproducible. Here is a stack trace:

java.lang.NullPointerException: null                                                                                                                                                                                 
        at org.openbase.bco.dal.remote.layer.unit.AbstractUnitRemote.addServiceStateObserver(AbstractUnitRemote.java:274)                                                                                            
        at org.openbase.bco.app.openapiserver.spring.UnitApiController.getUnitEvents(UnitApiController.java:148)                                                                                                     
        at org.openbase.bco.app.openapiserver.spring.UnitApiController$$FastClassBySpringCGLIB$$51721e62.invoke()
DivineThreepwood commented 4 years ago

Thanks for the report, both issue has been addressed. There is an InvalidStateException thrown In case the service state is not supported. If the service type is declared as UNKNOWN, then all available service states are observed. Please close issue if everything is working like you expected.