GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: Close Open Handle for Empty Objects (#2338) · googleapis/google-cloud-node@9974409

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • handwritten/storage/src
    • file.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎handwritten/storage/src/file.ts‎

Copy file name to clipboardExpand all lines: handwritten/storage/src/file.ts
+8-2Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2173,8 +2173,14 @@ class File extends ServiceObject<File, FileMetadata> {
21732173
.on('end', () => {
21742174
// In the case of an empty file no data will be received before the end event fires
21752175
if (!receivedData) {
2176-
fs.openSync(destination, 'w');
2177-
callback(null, Buffer.alloc(0));
2176+
const data = Buffer.alloc(0);
2177+
2178+
try {
2179+
fs.writeFileSync(destination, data);
2180+
callback(null, data);
2181+
} catch (e) {
2182+
callback(e as Error, data);
2183+
}
21782184
}
21792185
});
21802186
} else {

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.