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

[sensebox] Fixed potential NPE introduced in PR 8171 #8176

Merged
merged 1 commit into from
Jul 23, 2020

Conversation

cweitkamp
Copy link
Contributor

Signed-off-by: Christoph Weitkamp github@christophweitkamp.de

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
@cweitkamp cweitkamp requested a review from hakan42 as a code owner July 23, 2020 10:58
@kaikreuzer
Copy link
Member

Is this only "potentially" or an actual problem in the 2.5.7 build that just finished today?

@kaikreuzer kaikreuzer added the bug An unexpected problem or unintended behavior of an add-on label Jul 23, 2020
@kaikreuzer kaikreuzer added this to the 2.5.8 milestone Jul 23, 2020
@kaikreuzer kaikreuzer merged commit 17ca235 into openhab:2.5.x Jul 23, 2020
@cweitkamp cweitkamp deleted the bugfix-sensebox-npe branch July 26, 2020 07:48
@cweitkamp
Copy link
Contributor Author

To be honest I am not sure. I did not see it yet - the boxes I am tracking seem to expose those data or an empty String. This is an additional safe-guard because org.apache.commons.lang.StringUtils methods always checked for null first.

@heiler
Copy link

heiler commented Jul 26, 2020

With version 2.5.7 I see

2020-07-25 12:08:39.743 [ERROR] [ome.core.thing.link.ThingLinkManager] - Exception occurred while informing handler: null
java.lang.NullPointerException: null
	at org.openhab.binding.sensebox.internal.SenseBoxAPIConnection.reallyFetchDataFromServer(SenseBoxAPIConnection.java:141) ~[?:?]
	at org.openhab.binding.sensebox.internal.handler.SenseBoxHandler.lambda$0(SenseBoxHandler.java:106) ~[?:?]
	at org.eclipse.smarthome.core.cache.ExpiringCache.refreshValue(ExpiringCache.java:101) ~[?:?]
	at org.eclipse.smarthome.core.cache.ExpiringCache.getValue(ExpiringCache.java:72) ~[?:?]
	at org.eclipse.smarthome.core.cache.ExpiringCacheMap.get(ExpiringCacheMap.java:198) ~[?:?]
	at org.openhab.binding.sensebox.internal.handler.SenseBoxHandler.fetchData(SenseBoxHandler.java:163) ~[?:?]
	at org.openhab.binding.sensebox.internal.handler.SenseBoxHandler.handleCommand(SenseBoxHandler.java:119) ~[?:?]
	at org.eclipse.smarthome.core.thing.binding.BaseThingHandler.channelLinked(BaseThingHandler.java:191) ~[bundleFile:?]
	at org.eclipse.smarthome.core.thing.link.ThingLinkManager.lambda$0(ThingLinkManager.java:267) [bundleFile:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
	at java.lang.Thread.run(Thread.java:834) [?:?]

2020-07-25 12:08:39.792 [ERROR] [ome.core.thing.link.ThingLinkManager] - Exception occurred while informing handler: null
java.lang.NullPointerException: null
	at org.openhab.binding.sensebox.internal.SenseBoxAPIConnection.reallyFetchDataFromServer(SenseBoxAPIConnection.java:141) ~[?:?]
	at org.openhab.binding.sensebox.internal.handler.SenseBoxHandler.lambda$0(SenseBoxHandler.java:106) ~[?:?]
	at org.eclipse.smarthome.core.cache.ExpiringCache.refreshValue(ExpiringCache.java:101) ~[?:?]
	at org.eclipse.smarthome.core.cache.ExpiringCache.getValue(ExpiringCache.java:72) ~[?:?]
	at org.eclipse.smarthome.core.cache.ExpiringCacheMap.get(ExpiringCacheMap.java:198) ~[?:?]
	at org.openhab.binding.sensebox.internal.handler.SenseBoxHandler.fetchData(SenseBoxHandler.java:163) ~[?:?]
	at org.openhab.binding.sensebox.internal.handler.SenseBoxHandler.handleCommand(SenseBoxHandler.java:119) ~[?:?]
	at org.eclipse.smarthome.core.thing.binding.BaseThingHandler.channelLinked(BaseThingHandler.java:191) ~[bundleFile:?]
	at org.eclipse.smarthome.core.thing.link.ThingLinkManager.lambda$0(ThingLinkManager.java:267) [bundleFile:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
	at java.lang.Thread.run(Thread.java:834) [?:?]

Is this bug covered by this fix?

Kind regards

@cweitkamp
Copy link
Contributor Author

Yes, that is exactly the case covered by this fix.

CSchlipp pushed a commit to CSchlipp/openhab-addons that referenced this pull request Jul 26, 2020
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
Signed-off-by: CSchlipp <christian@schlipp.de>
MPH80 pushed a commit to MPH80/openhab-addons that referenced this pull request Aug 3, 2020
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
Signed-off-by: MPH80 <michael@hazelden.me>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this pull request Aug 31, 2020
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this pull request Aug 31, 2020
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this pull request Aug 31, 2020
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this pull request Aug 31, 2020
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
DaanMeijer pushed a commit to DaanMeijer/openhab-addons that referenced this pull request Sep 1, 2020
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
Signed-off-by: Daan Meijer <daan@studioseptember.nl>
markus7017 pushed a commit to markus7017/openhab-addons that referenced this pull request Sep 19, 2020
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants