Skip to content

[lexical-react] Bug Fix: Prevent error when editorRef is null#8329

Merged
etrepum merged 1 commit into
facebook:mainfrom
Jimmy89:main
Apr 10, 2026
Merged

[lexical-react] Bug Fix: Prevent error when editorRef is null#8329
etrepum merged 1 commit into
facebook:mainfrom
Jimmy89:main

Conversation

@Jimmy89

@Jimmy89 Jimmy89 commented Apr 10, 2026

Copy link
Copy Markdown
Contributor

Description

editorRef is allowed to be null and must be checked on this type before value allocation. This PR adds that check.

Closes #8327

Test plan

Add a LexicalEditor with a LexicalEditorRefPlugin where editorRef is value null.

Old situation: error
New situation: line of error skipped

editorRef is allowed to be null and must be checked on this type before value allocation.
@meta-cla

meta-cla Bot commented Apr 10, 2026

Copy link
Copy Markdown

Hi @Jimmy89!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@vercel

vercel Bot commented Apr 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lexical Ready Ready Preview, Comment Apr 10, 2026 3:00pm
lexical-playground Ready Ready Preview, Comment Apr 10, 2026 3:00pm

Request Review

@meta-cla

meta-cla Bot commented Apr 10, 2026

Copy link
Copy Markdown

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 10, 2026

@etrepum etrepum left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It looks like editorRef is not allowed to be null according to TypeScript but being a little more defensive here doesn't hurt

@etrepum etrepum added this pull request to the merge queue Apr 10, 2026
Merged via the queue into facebook:main with commit 8a8a823 Apr 10, 2026
37 checks passed
@etrepum etrepum mentioned this pull request Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: LexicalEditorRefPlugin crashes if input is null

2 participants