Fix fatal error when resolving line discussions with thread auto-collapse feature
The following discussion from !217858 should be addressed:
- [x] @ms.mondrian started a [discussion](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/217858#note_3000311719): (+3 comments)
> **issue** - resolving a file level thread errors out
>
> {width=648 height=600}
- [ ] This turned out to be not replicable, but did expose a different (basically inert) error:
> I can't replicate this error at all, but **do** get a console fatal error - that isn't displayed in the UI - on every _other_ (line) collapse.
-----
The fatal error is displayed in the console, but does not impact either the UI (no banner or notification), and does not block the auto-collapse.
issue