Skip to content

Fix: NullReferenceException in Satellite Service on unknown types#441

Merged
amadeo-alex merged 1 commit into
hass-agent:development-2.2.1from
Bluscream:fix/satellite-null-sensors
Mar 22, 2026
Merged

Fix: NullReferenceException in Satellite Service on unknown types#441
amadeo-alex merged 1 commit into
hass-agent:development-2.2.1from
Bluscream:fix/satellite-null-sensors

Conversation

@Bluscream

@Bluscream Bluscream commented Mar 21, 2026

Copy link
Copy Markdown

The Satellite Service currently crashes with a NullReferenceException if the configuration contains entity types it doesn't support (like WebView commands or Bluetooth sensors). This happens because the conversion logic returns null but the caller still adds it to the active collection and later tries to publish it. This PR adds null checks to safely skip these unknown types. Without the fix it gives no indication to the user that something went wrong and instead constantly fails silently in the service logs.

…avoids a NullReferenceException when the Satellite Service encounters unsupported entity types (e.g. WebViewCommand, Bluetooth sensors) that aren't available in the headless service context.
@amadeo-alex amadeo-alex changed the base branch from main to development-2.2.1 March 22, 2026 10:24
@amadeo-alex

Copy link
Copy Markdown
Collaborator

Now I wonder what kind of sneakery you were up to to find this :D
Tried to add some configuration manually?

Jokes aside the entity initialisation code is not up to "standard" - will be fixed with the full rewrite tho.

Looks good, gonna double check the files before merging and make it part of 2.2.1 (should have some time next week to push it out).

@amadeo-alex amadeo-alex added the PR - In progress PR review was started and ongoing label Mar 22, 2026
@amadeo-alex amadeo-alex changed the title Fix NullReferenceException in Satellite Service on unknown types Fix: NullReferenceException in Satellite Service on unknown types Mar 22, 2026
@amadeo-alex amadeo-alex merged commit 3ab46fb into hass-agent:development-2.2.1 Mar 22, 2026
@Bluscream

Copy link
Copy Markdown
Author

Now I wonder what kind of sneakery you were up to to find this :D
Tried to add some configuration manually?

found this because i had non-satellite items in my satellite configs (basically #442)

@amadeo-alex amadeo-alex mentioned this pull request Jun 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR - In progress PR review was started and ongoing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants