Throw for falsy fileArrayBuffer

This commit is contained in:
Sam Carlton 2022-08-20 21:35:57 -05:00
parent 0cfb9efe29
commit 6d0fafd041

View file

@ -9,6 +9,10 @@ export async function runScanWorker ( file, messageReceiver = noop ) {
const fileArrayBuffer = ( typeof file.arrayBuffer === 'function' ) ? (await file.arrayBuffer()) : file.arrayBuffer
if ( !fileArrayBuffer ) {
throw new Error( 'No fileArrayBuffer' )
}
const scan = await new Promise( ( resolve, reject ) => {
// Set up the worker message handler
appScanWorker.onmessage = async (event) => {