# Fix crash due to mutating command palette's candidates on confirmation \(\#3575\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 188d727d31daeae0740b8d5435af52343ff03581

Requested commit: 188d727d31daeae0740b8d5435af52343ff03581

Commit: 188d727d31daeae0740b8d5435af52343ff03581

Tree: eeb0def83eca462c60dddb5ed2b73273dfb19949

Author: Max Brunsfeld

Committer: GitHub

## Message

```
Fix crash due to mutating command palette's candidates on confirmation (#3575)

I was seeing a crash when confirming the command palette. It was caused
by getting the palette's `commands` (match candidates) and `matches`
getting out of sync because we mutated `commands` when removing the
selected command.
```

## Parents

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

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

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