Skip to content

Commit

Permalink
Merge pull request #1000 from nextcloud-libraries/bugfix/noid/error-o…
Browse files Browse the repository at this point in the history
…n-choose

[stable4] Avoid error when not using any custom buttons
  • Loading branch information
susnux authored Sep 14, 2023
2 parents 7d9d29e + 8d547d8 commit 424c21e
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 424c21e

Please sign in to comment.