diff --git a/lib/modules/firestore/Blob.js b/lib/modules/firestore/Blob.js index 3d8149e9..6f4f5bb9 100644 --- a/lib/modules/firestore/Blob.js +++ b/lib/modules/firestore/Blob.js @@ -14,6 +14,12 @@ export default class Blob { * @param base64 string */ static fromBase64String(base64: string): Blob { + if (typeof base64 !== 'string' || base64.length < 1) { + throw new Error( + 'firestore.Blob.fromBase64String expects a string of at least 1 character in length' + ); + } + return new Blob(Base64.atob(base64)); }