Skip to content

Fix for missing DeviceClient.writer#1

Open
toxuin wants to merge 1 commit into
AiDot-Development-Team:mainfrom
toxuin:patch-1
Open

Fix for missing DeviceClient.writer#1
toxuin wants to merge 1 commit into
AiDot-Development-Team:mainfrom
toxuin:patch-1

Conversation

@toxuin

@toxuin toxuin commented Jul 2, 2025

Copy link
Copy Markdown

This fixes a crash for a case when the integrating app is trying to open comms with a device that has not been connected to yet. Ideally, it should fail gracefully, but it currently crashes the whole app with an error AttributeError: 'DeviceClient' object has no attribute 'writer'.

The first assignment to those attributes happens in connect, so in a happy path scenario it works alright, but happens to explode if any method was called before connect. This should fix that.

This PR fixes that by initializing both reader and writer to None values in the constructor - just like in connect method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant