Skip to content

Commit 504f4e0

Browse files
authored
Fix library_pthread.js onmessage error detection. #16239 (comment) (#16450)
1 parent 47a0284 commit 504f4e0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/library_pthread.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,10 @@ var LibraryPThread = {
296296
if (Module['onAbort']) {
297297
Module['onAbort'](d['arg']);
298298
}
299-
} else {
299+
} else if (cmd) {
300+
// The received message looks like something that should be handled by this message
301+
// handler, (since there is a e.data.cmd field present), but is not one of the
302+
// recognized commands:
300303
err("worker sent an unknown command " + cmd);
301304
}
302305
PThread.currentProxiedOperationCallerThread = undefined;

0 commit comments

Comments
 (0)