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
juliusknorr committed Sep 14, 2023
1 parent 7d9d29e commit f4b111d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/filepicker.ts
Original file line number Diff line number Diff line change
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 f4b111d

Please sign in to comment.