# agent_ui: Fix crash when filtering tools in the agent profile tool picker \(\#58299\) · gitcafe/zed

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

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

Visibility: public

Requested revision: f65b6f6e36b32826bfde43566d6d2ba83706a412

Requested commit: f65b6f6e36b32826bfde43566d6d2ba83706a412

Commit: f65b6f6e36b32826bfde43566d6d2ba83706a412

Tree: 83fefb9aca66407381e1deb63f373243a937f920

Author: Smit Barmase

Committer: GitHub

## Message

```
agent_ui: Fix crash when filtering tools in the agent profile tool picker (#58299)

Closes ZED-8SQ

This PR uses the same pattern for `can_select` as other delegates and
also guards `can_select` call in `Picker::render_element` which was
regressed in #50705.

Release Notes:

- Fixed a crash that could occur when searching or configuring tools in
agent profile settings.
```

## Parents

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

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