diff --git a/packages/@uppy/core/src/Uppy.ts b/packages/@uppy/core/src/Uppy.ts index 8009e71259..22e5af3d8b 100644 --- a/packages/@uppy/core/src/Uppy.ts +++ b/packages/@uppy/core/src/Uppy.ts @@ -649,9 +649,9 @@ export class Uppy< ...files[fileID].progress, ...defaultProgress, }, - // @ts-expect-error these typed are inserted - // into the namespace in their respective packages - // but core isn't ware of those + // these types are inserted into the namespace in their + // respective packages but core isn't aware of those + // @ts-expect-error tus: undefined, transloadit: undefined, } @@ -899,7 +899,9 @@ export class Uppy< try { this.#restricter.validateSingleFile(file) } catch (err) { - return err.message + if (err instanceof Error) { + return err.message + } } return null } @@ -911,7 +913,9 @@ export class Uppy< try { this.#restricter.validateAggregateRestrictions(existingFiles, files) } catch (err) { - return err.message + if (err instanceof Error) { + return err.message + } } return null }