Skip to content

Commit

Permalink
fix: replace "assert" with defensive "if" (#1504)
Browse files Browse the repository at this point in the history
I missed to update this place as well in #1502.
  • Loading branch information
ankon committed Feb 3, 2022
1 parent 5ee74fc commit 4f71498
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/dull-vans-tap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@remirror/extension-yjs': patch
---

Replace wrong assertion
6 changes: 4 additions & 2 deletions packages/remirror__extension-yjs/src/yjs-extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import type {
import { transact, UndoManager } from 'yjs';
import {
AcceptUndefined,
assert,
command,
convertCommand,
Dispose,
Expand Down Expand Up @@ -163,7 +162,10 @@ class YjsAnnotationStore<Type extends Annotation> implements AnnotationStore<Typ

updateAnnotation(id: string, updateData: OmitTextAndPosition<Type>): void {
const existing = this.map.get(id);
assert(existing);

if (!existing) {
return;
}

this.map.set(id, {
...updateData,
Expand Down

1 comment on commit 4f71498

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 Published on https://remirror.io as production
🚀 Deployed on https://61fc346bfba0c1005d4fda45--remirror.netlify.app

Please sign in to comment.