# workspace: Fix panic when discarding a draft workspace \(\#60279\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 7eb4cb2bfa02618761389d5e760a9a9b6763f301

Requested commit: 7eb4cb2bfa02618761389d5e760a9a9b6763f301

Commit: 7eb4cb2bfa02618761389d5e760a9a9b6763f301

Tree: 73a4a7bc5cc6d7cb1526602396ae6bac59fcb099

Author: Smit Barmase

Committer: GitHub

## Message

```
workspace: Fix panic when discarding a draft workspace (#60279)

To reproduce:

1. Open a git project with the agent sidebar, ideally with no other
threads in the sidebar.
2. Create a thread in a new git worktree and type into it without
sending.
3. While still in that worktree workspace, hit New Thread. The parked
draft must now be the last activatable entry in the sidebar.
4. Hover the parked draft → click Discard Draft
5. 💥

Release Notes:

- Fixed a panic when discarding a draft workspace.
```

## Parents

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

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