From 7bd6e5f4e1e5557700208c20ec00aad51ae91b16 Mon Sep 17 00:00:00 2001 From: Ben Heidemann Date: Sun, 18 Apr 2021 16:22:27 +0100 Subject: [PATCH] fix: handle case data = 0 in writeFile --- src/filesystem/implementation.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/filesystem/implementation.js b/src/filesystem/implementation.js index 5e839da..f58542f 100644 --- a/src/filesystem/implementation.js +++ b/src/filesystem/implementation.js @@ -1873,6 +1873,7 @@ function writeFile(context, path, data, options, callback) { if(typeof data === 'number') { data = '' + data; } + data = data || ''; if(typeof data !== 'string') { data = Buffer.from(data.toString()); }