Skip to content

Commit 192ccfd

Browse files
committed
Properly return 0 instead of emtpy return
This emerged while investigating #1658, but reproduction is not deterministic so hard to say
1 parent b22b361 commit 192ccfd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/duckdb-wasm/src/bindings/runtime_browser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ export const BROWSER_RUNTIME: DuckDBRuntime & {
308308
// so we need (if enabled) to bump to a ranged GET
309309
if (!BROWSER_RUNTIME.getGlobalFileInfo(mod)?.allowFullHttpReads) {
310310
failWith(mod, `HEAD request failed: ${path}, with full http reads are disabled`);
311-
return;
311+
return 0;
312312
}
313313
const xhr2 = new XMLHttpRequest();
314314
if (path.startsWith('s3://')) {
@@ -322,7 +322,7 @@ export const BROWSER_RUNTIME: DuckDBRuntime & {
322322
xhr2.send(null);
323323
if (xhr2.status != 200 && xhr2.status !== 206) {
324324
failWith(mod, `HEAD and GET requests failed: ${path}`);
325-
return;
325+
return 0;
326326
}
327327
const contentLength = xhr2.getResponseHeader('Content-Length');
328328
if (contentLength && (+contentLength > 1)) {

0 commit comments

Comments
 (0)