1
0
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:
Cary Dunn
2019-05-20 13:34:16 -07:00
committed by Ian Storm Taylor
parent 020672a2ea
commit 7adf56ffd1

View File

@@ -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
} }