adds error catching for empty pages

moves index page to blog post format rather than static page
This commit is contained in:
Rosia E Evans 2023-09-29 15:07:29 +01:00
parent 63fc2fa47f
commit 06b45e46c9
2 changed files with 2 additions and 39 deletions

View file

@ -4,6 +4,8 @@
void Page::calculatePageFlags()
{
int endOfFirstLine = sourceFileContents.find_first_of("\n");
if (endOfFirstLine == -1)
throw sourceFileUrl + " is empty or all on one line";
std::string tagLine = sourceFileContents.substr(0, endOfFirstLine);
sourceFileContents = sourceFileContents.substr(endOfFirstLine, sourceFileContents.length()-endOfFirstLine);