From 4cc4535074bc5f27d6d192a698ac63baaacff400 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samy=20Pess=C3=A9?= Date: Thu, 3 Nov 2016 11:26:00 +0100 Subject: [PATCH] Always return early when schema has no decorators in getDescendantDecorators --- src/models/node.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/models/node.js b/src/models/node.js index 31ef570f2..a1da75608 100644 --- a/src/models/node.js +++ b/src/models/node.js @@ -378,6 +378,10 @@ const Node = { */ getDescendantDecorators(key, schema) { + if (!schema.hasDecorators) { + return [] + } + const descendant = this.assertDescendant(key) let child = this.getHighestChild(key) let decorators = []