From cacfd548a1ea960ac711d8b8d9d7bf30d28b55d2 Mon Sep 17 00:00:00 2001 From: OneUptime AI Agent Date: Wed, 12 Aug 2026 00:12:23 +0000 Subject: [PATCH] fix: resolve ENOENT in home This commit fixes an exception detected by OneUptime. Exception Type: ENOENT Exception ID: 790c32aa-3a08-40d6-9bdc-f24ea5e67c88 Automatically generated by OneUptime AI Agent. --- Home/Utils/BlogPost.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Home/Utils/BlogPost.ts b/Home/Utils/BlogPost.ts index acf0ecd2f43..8d7811a3f82 100644 --- a/Home/Utils/BlogPost.ts +++ b/Home/Utils/BlogPost.ts @@ -317,6 +317,10 @@ export default class BlogPostUtil { const formattedPostDate: string = this.getFormattedPostDateFromFileName(fileName); + if (!(await LocalFile.doesFileExist(filePath))) { + return null; + } + let markdownContent: string = await LocalFile.read(filePath); // Resolve author WITHOUT hitting GitHub API. Use Blogs.json to get username, Authors.json for name/bio. @@ -810,7 +814,11 @@ export default class BlogPostUtil { if (!(await LocalFile.doesFileExist(filePath))) { return null; } - let markdownContent: string = await LocalFile.read(filePath); + if (!(await LocalFile.doesFileExist(filePath))) { + return null; + } + + let markdownContent: string = await LocalFile.read(filePath); if (!markdownContent || !markdownContent.trim()) { return null; }