# assistant_context_editor: Try to fix crash when trying to view patch \(\#25572\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 014d9dfce15e6825d86b8010780a5022d91e1538

Requested commit: 014d9dfce15e6825d86b8010780a5022d91e1538

Commit: 014d9dfce15e6825d86b8010780a5022d91e1538

Tree: 8445c561776bbbdd31cee3759ea060cd7e9aca01

Author: Ben Kunkle

Committer: GitHub

## Message

```
assistant_context_editor: Try to fix crash when trying to view patch (#25572)

Closes #24571

Attempts to fix crash described in #24571 based on the panic trace
provided by the user. In short, the panic seemed to be caused by
attempting to read an `Entity<ContextEditor>` while it was being
updated. My assumption is that at some point in
`workspace.add_item_to_current_pane` the `ContextEditor` is read.
Therefore, I moved the workspace update outside of the ContextEditor
update, and replaced another `update` call with a `read` call to clean
it up and just in case that was actually the issue.

Release Notes:

- N/A
```

## Parents

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

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