From 4b4b685bba0ce1a37870b165e524df4623a22cf1 Mon Sep 17 00:00:00 2001 From: Bartlomiej Witczak Date: Tue, 26 Jan 2021 12:02:54 +0100 Subject: [PATCH] fix: runtime error if no buttons are present in toolbar (#4680) Co-authored-by: Bartek Witczak --- src/node/utils/toolbar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node/utils/toolbar.js b/src/node/utils/toolbar.js index a76e5b200..3e435d28b 100644 --- a/src/node/utils/toolbar.js +++ b/src/node/utils/toolbar.js @@ -59,7 +59,7 @@ ButtonsGroup.prototype.addButton = function (button) { ButtonsGroup.prototype.render = function () { if (this.buttons && this.buttons.length === 1) { this.buttons[0].grouping = ''; - } else { + } else if (this.buttons && this.buttons.length > 1) { _.first(this.buttons).grouping = 'grouped-left'; _.last(this.buttons).grouping = 'grouped-right'; _.each(this.buttons.slice(1, -1), (btn) => {