Skip to content

Commit

Permalink
fix: Do not log console errors if buttons is an empty array
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <jus@bitgrid.net>
  • Loading branch information
juliushaertl committed Sep 14, 2023
1 parent 7d9d29e commit 8d547d8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/filepicker.ts
Expand Up @@ -143,7 +143,7 @@ export class FilePickerBuilder {
}

public build(): FilePicker {
if (this.buttons && this.type !== FilePickerType.Custom) {
if (this.buttons?.length > 0 && this.type !== FilePickerType.Custom) {
console.error('FilePickerBuilder: When adding custom buttons the `type` must be set to `FilePickerType.Custom`.')
}

Expand Down

0 comments on commit 8d547d8

Please sign in to comment.