diff --git a/doc/api/fs.md b/doc/api/fs.md index c794da1cac8576..bc3e29c6aadb03 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -7638,7 +7638,7 @@ try { fd = await open('/open/some/file.txt', 'r'); // Do something with the file } finally { - await fd.close(); + await fd?.close(); } ``` @@ -7652,7 +7652,7 @@ try { fd = await open('file.txt', 'r'); // Do something with the file } finally { - await fd.close(); + await fd?.close(); } ``` @@ -7767,7 +7767,7 @@ try { fd = await open(Buffer.from('/open/some/file.txt'), 'r'); // Do something with the file } finally { - await fd.close(); + await fd?.close(); } ```