Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion Home/Utils/BlogPost.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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;
}
Expand Down
Loading