fix: runtime error if no buttons are present in toolbar (#4680)

Co-authored-by: Bartek Witczak <bartek@dayone.pl>
pull/4672/head
Bartlomiej Witczak 2021-01-26 12:02:54 +01:00 committed by GitHub
parent b73b0bcb98
commit 4b4b685bba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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) => {