mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -07:00
Throw for falsy fileArrayBuffer
This commit is contained in:
parent
0cfb9efe29
commit
6d0fafd041
1 changed files with 4 additions and 0 deletions
|
|
@ -9,6 +9,10 @@ export async function runScanWorker ( file, messageReceiver = noop ) {
|
||||||
|
|
||||||
const fileArrayBuffer = ( typeof file.arrayBuffer === 'function' ) ? (await file.arrayBuffer()) : file.arrayBuffer
|
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 ) => {
|
const scan = await new Promise( ( resolve, reject ) => {
|
||||||
// Set up the worker message handler
|
// Set up the worker message handler
|
||||||
appScanWorker.onmessage = async (event) => {
|
appScanWorker.onmessage = async (event) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue