Device controls nullpointerexception for a few domains
See original GitHub issueHome Assistant Android version: beta-2124-3de19889
Android version: 12 and others
Phone model:
Redmi Note 9 Pro and others
Home Assistant version: unknown
Last working Home Assistant release (if known): unknown
Description of problem:
Looking at sentry we have a few new bugs coming in that all have the same error message, seems like this was introduced in the latest beta (at least according to sentry)
Traceback (if applicable, to get the logs you may refer to: https://companion.home-assistant.io/docs/troubleshooting/faqs/#android-crash-logs):
java.lang.NullPointerException: null cannot be cast to non-null type kotlin.Int
at java.util.Objects.requireNonNull(Objects.java:245)
at io.homeassistant.companion.android.controls.VacuumControl$Companion.provideControlFeatures(VacuumControl.kt:30)
at io.homeassistant.companion.android.controls.HaControl$DefaultImpls.createControl(HaControl.kt:43)
at io.homeassistant.companion.android.controls.VacuumControl$Companion.createControl(VacuumControl.kt:20)
at io.homeassistant.companion.android.controls.HaControlsProviderService.sendEntitiesToSubscriber(HaControlsProviderService.kt:216)
at io.homeassistant.companion.android.controls.HaControlsProviderService.access$sendEntitiesToSubscriber(HaControlsProviderService.kt:28)
at io.homeassistant.companion.android.controls.HaControlsProviderService$createPublisherFor$1$1$request$1.invokeSuspend(HaControlsProviderService.kt:138)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:39)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
java.lang.NullPointerException: null cannot be cast to non-null type kotlin.Int
at java.util.Objects.requireNonNull(Objects.java:245)
at io.homeassistant.companion.android.controls.CoverControl$Companion.provideControlFeatures(CoverControl.kt:50)
at io.homeassistant.companion.android.controls.HaControl$DefaultImpls.createControl(HaControl.kt:43)
at io.homeassistant.companion.android.controls.CoverControl$Companion.createControl(CoverControl.kt:23)
at io.homeassistant.companion.android.controls.HaControlsProviderService.sendEntitiesToSubscriber(HaControlsProviderService.kt:216)
at io.homeassistant.companion.android.controls.HaControlsProviderService.access$sendEntitiesToSubscriber(HaControlsProviderService.kt:28)
at io.homeassistant.companion.android.controls.HaControlsProviderService$createPublisherFor$1$1$request$1.invokeSuspend(HaControlsProviderService.kt:138)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:39)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
java.lang.NullPointerException: null cannot be cast to non-null type kotlin.Int
at java.util.Objects.requireNonNull(Objects.java:245)
at io.homeassistant.companion.android.controls.FanControl$Companion.provideControlFeatures(FanControl.kt:31)
at io.homeassistant.companion.android.controls.HaControl$DefaultImpls.createControl(HaControl.kt:43)
at io.homeassistant.companion.android.controls.FanControl$Companion.createControl(FanControl.kt:23)
at io.homeassistant.companion.android.controls.HaControlsProviderService.sendEntitiesToSubscriber(HaControlsProviderService.kt:216)
at io.homeassistant.companion.android.controls.HaControlsProviderService.access$sendEntitiesToSubscriber(HaControlsProviderService.kt:28)
at io.homeassistant.companion.android.controls.HaControlsProviderService$createPublisherFor$1$1$request$1.invokeSuspend(HaControlsProviderService.kt:138)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:39)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
Screenshot of problem:
Additional information: CC: @jpelgrom as I believe this may be related to a recent PR?
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (11 by maintainers)
Top Results From Across the Web
NullPointerException on some phones, not others (same API ...
I have an Android app that is getting a NullPointerException on some phones (all 2.3.x) but not on my phone (also 2.3.x) or...
Read more >Java NullPointerException - Detect, Fix, and Best Practices
NullPointerException is raised in an application when we are trying to do some operation on null where an object is required. Some of...
Read more >CrossOverDomain problem - null value exceptions every few ...
Hello,. It appears I have a problem with a Crossover Domain. I am getting java Null Pointer Exceptions every few minutes in my...
Read more >Null pointer exception when locking domains — oracle-tech
So I selected the Domains directory in the Browser and pressed Team>Lock. This gives a null pointer exception: java.lang.
Read more >"System.NullPointerException: Attempt to de-reference a null ...
I got this error upon trying to deploy a custom controller and test class from sandbox to production: "System.NullPointerException: Attempt ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Closing this issue for now, lets revisit if a user comes to us with an issue.
To fix this I would add a null check to the supported features comparisons (for example
(entity.attributes["supported_features"] as? Int)?.and(SUPPORT_SET_POSITION) == SUPPORT_SET_POSITION
), but given that it is affecting more than a few people and the cause is unclear I’m actually interested in whether the amount grows in the next few days, and if other controls and app versions will start showing this exception as well.