Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: error trying to do in on a null value in is ui function call #1132

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/document/UI.ts
Expand Up @@ -19,9 +19,9 @@ export type UIValueString = String & {[UIValue]: true}
export type UISelectionStart = Number & {[UISelection]: true}

export function isUIValue(
value: string | UIValueString,
value: string | UIValueString | null,
): value is UIValueString {
return typeof value === 'object' && UIValue in value
return typeof value === 'object' && value !== null && UIValue in value
}

export function isUISelectionStart(
Expand Down