Skip to content

Commit

Permalink
Fix moved pages when origin page doesn't exists
Browse files Browse the repository at this point in the history
  • Loading branch information
marcopagliarulo committed May 24, 2023
1 parent 37ecab0 commit 8dc2714
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/bodiless-backend/src/page.ts
Expand Up @@ -441,7 +441,7 @@ class Page {
const { sep, normalize } = path;
const dirPath = normalize(this.directory);
const [, pageRelativeDir] = dirPath.split(`${sep}data${sep}pages${sep}`);
if (!pageRelativeDir) {
if (!pageRelativeDir || !fs.existsSync(this.directory)) {
resolve('The page cannot be deleted.');
return;
}
Expand Down

0 comments on commit 8dc2714

Please sign in to comment.