Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE in some converters when calculating updated attributes #432

Closed
TomTravaglino opened this issue May 3, 2019 · 2 comments · Fixed by #434
Closed

NPE in some converters when calculating updated attributes #432

TomTravaglino opened this issue May 3, 2019 · 2 comments · Fixed by #434

Comments

@TomTravaglino
Copy link
Contributor

Caused by #427 and #409

I'm experiencing a NPE in the method ZigBeeConverterMeasurementPower.attributeUpdated(...) thrown by this statement:

BigDecimal valueInWatt = BigDecimal.valueOf(value * multiplier / divisor);

The reason is that multiplier and divisor are both null. This happens because since #427 these variables are initialized in the method initializeDevice() which since #409 is only invoked on the very first initialization and then only initializeConverter() will be called on startup. Such variables should be better initialized in the method initializeConverter().

Other converters which currently use to initialize variables in initializeDevice() will need to be changed too (didn't check them all).

@cdjackson
Copy link
Contributor

cdjackson commented May 3, 2019 via email

@cdjackson
Copy link
Contributor

Duplicate of #430

@cdjackson cdjackson marked this as a duplicate of #430 May 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants