mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-21 22:45:18 +02:00
gracefully handle null content ref in findDOMNode query (#2774)
This commit is contained in:
committed by
Ian Storm Taylor
parent
020672a2ea
commit
7adf56ffd1
@@ -23,6 +23,10 @@ function QueriesPlugin() {
|
|||||||
path = PathUtils.create(path)
|
path = PathUtils.create(path)
|
||||||
const content = editor.tmp.contentRef.current
|
const content = editor.tmp.contentRef.current
|
||||||
|
|
||||||
|
if (!content) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
if (!path.size) {
|
if (!path.size) {
|
||||||
return content.ref.current || null
|
return content.ref.current || null
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user