🐛 Fixed potential for partial content re-generation in 4.0 migrations (#13120)

no issue

- incorrect syntax was used in the error handlers inside of the `for` loop, by using `return` when logging the whole for-loop was aborted whereas we want to log and continue processing the rest of the items
This commit is contained in:
Kevin Ansfield 2021-07-06 10:15:32 +01:00 committed by GitHub
parent 05b317af9d
commit 541fb4d2db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,10 +30,12 @@ module.exports = createIrreversibleMigration(async (knex) => {
mobiledoc = JSON.parse(post.mobiledoc || null);
if (!mobiledoc) {
return logging.warn(`No mobiledoc for ${id}. Skipping.`);
logging.warn(`No mobiledoc for ${id}. Skipping.`);
continue;
}
} catch (err) {
return logging.warn(`Invalid JSON structure for ${id}. Skipping`);
logging.warn(`Invalid JSON structure for ${id}. Skipping`);
continue;
}
const html = mobiledocLib.mobiledocHtmlRenderer.render(mobiledoc);