Skip to content

Fix SelectCurrent.update() crash when called before mount (#6581) - #6680

Open
rudrakumar07 wants to merge 1 commit into
Textualize:mainfrom
rudrakumar07:fix-select-update-before-mount
Open

Fix SelectCurrent.update() crash when called before mount (#6581)#6680
rudrakumar07 wants to merge 1 commit into
Textualize:mainfrom
rudrakumar07:fix-select-update-before-mount

Conversation

@rudrakumar07

Copy link
Copy Markdown

Fixes #6581.

SelectCurrent.update() queried #label before the widget was mounted, causing a crash. Added if self.is_mounted: guard around the query_one call, matching the existing pattern in _watch_prompt.

Guard the query_one("#label") call in SelectCurrent.update() with
an is_mounted check. When update() is called before the widget is
mounted (e.g., from _watch_value during initialization), the #label
child doesn't exist yet, causing a NoMatches crash.

Fixes Textualize#6581
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.

Select can crash during mount: SelectCurrent.update() queries #label before it is mounted (NoMatches)

1 participant