Skip to content

Commit fe19dfa

Browse files
committed
webR: don't set up the filesystem if there are no files
webR would eventually fail after running a few blocks of code in different contexts, if each block of code unmounted and then remounted the filesystem.
1 parent a7381b8 commit fe19dfa

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

programming.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,8 +580,16 @@ Numbas.addExtension('programming', ['display', 'util', 'jme'], function(programm
580580

581581
if(this.fs_mounted) {
582582
await FS.unmount(path);
583-
} else {
583+
this.fs_mounted = false;
584+
}
585+
586+
if(!blobs.length) {
587+
return;
588+
}
589+
590+
if(!this.fs_path_created) {
584591
await FS.mkdir(path);
592+
this.fs_path_created = true;
585593
}
586594

587595
await FS.mount("WORKERFS", {

0 commit comments

Comments
 (0)