diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/library.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/library.js b/src/library.js index 4d90fa05..407aa8c3 100644 --- a/src/library.js +++ b/src/library.js @@ -421,9 +421,9 @@ LibraryManager.library = { quit: function() { if (!FS.init.initialized) return; - // Flush any partially-printed lines in stdout and stderr - if (FS.streams[2].object.output.buffer.length > 0) FS.streams[2].object.output('\n'.charCodeAt(0)); - if (FS.streams[3].object.output.buffer.length > 0) FS.streams[3].object.output('\n'.charCodeAt(0)); + // Flush any partially-printed lines in stdout and stderr. Careful, they may have been closed + if (FS.streams[2] && FS.streams[2].object.output.buffer.length > 0) FS.streams[2].object.output('\n'.charCodeAt(0)); + if (FS.streams[3] && FS.streams[3].object.output.buffer.length > 0) FS.streams[3].object.output('\n'.charCodeAt(0)); } }, |