diff --git a/src/lib/picker.ts b/src/lib/picker.ts index 1c2bd962..a0afd1bb 100644 --- a/src/lib/picker.ts +++ b/src/lib/picker.ts @@ -787,7 +787,17 @@ class PickerLoader { const validateRes = getValidator(PickerParamsSchema)(options); if (validateRes.errors.length) { - throw new FilestackError(`Invalid picker params`, validateRes.errors, FilestackErrorType.VALIDATION); + validateRes.errors.forEach(error => { + if (error.path.includes('fromSources')) { + console.warn(`Warning: Invalid source \"${error.instance}\" found and removed!`); + options.fromSources = options.fromSources.filter(source => source !== error.instance); + } else { + throw new FilestackError(`Invalid picker params`, validateRes.errors, FilestackErrorType.VALIDATION); + } + }); + if (!options.fromSources.length) { + delete options.fromSources; + } } this._initialized = this.loadModule(client, options); diff --git a/src/schema/picker.schema.ts b/src/schema/picker.schema.ts index d7a1a44e..6b8355cc 100644 --- a/src/schema/picker.schema.ts +++ b/src/schema/picker.schema.ts @@ -68,6 +68,7 @@ export const PickerParamsSchema = { 'facebook', 'instagram', 'googledrive', + 'picasa', 'unsplash', 'dropbox', 'webcam',