# gpui: Fix panic with invalid focus IDs \(\#57885\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/777e16dd1f38f573c264eb15c783743ec37d7e1e)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 777e16dd1f38f573c264eb15c783743ec37d7e1e

Requested commit: 777e16dd1f38f573c264eb15c783743ec37d7e1e

Commit: 777e16dd1f38f573c264eb15c783743ec37d7e1e

Tree: 4b79029e555b39b2531bee54c38a81d6ca09e6fa

Author: Cameron Mcloughlin

Committer: GitHub

## Message

```
gpui: Fix panic with invalid focus IDs (#57885)

We were missing a check when setting the focused node ID, causing a
panic in accesskit's internal validation logic. Fixes the bug, and adds
some defensive logic to help mitigate potential future issues.

You can reproduce the panic by:
- turning on a screenreader
- launching zed
- opening a menu and pressing tab

This change fixes it.

Release Notes:

- N/A or Added/Fixed/Improved ...
```

## Parents

- [f0341c96a17630e5dfb441701441945dbb2a605a](https://git.cafe/gitcafe/zed/commit/f0341c96a17630e5dfb441701441945dbb2a605a?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/777e16dd1f38f573c264eb15c783743ec37d7e1e?format=markdown)
