0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-17 23:44:39 -05:00

Fixed mobiledoc being null in migration script

no issue

- we stringify the mobiledoc field and this ends in 'null'
- the model layer won't detect 'null'
This commit is contained in:
kirrg001 2018-08-11 11:52:44 +02:00 committed by Katharina Irrgang
parent f024b3ebb5
commit 86e8b368b6

View file

@ -46,6 +46,10 @@ module.exports.up = (options) => {
try {
mobiledoc = JSON.parse(post.get('mobiledoc') || null);
if (!mobiledoc) {
mobiledoc = converters.mobiledocConverter.blankStructure();
}
} catch (err) {
common.logging.warn(`Invalid mobiledoc structure for ${post.id}. Falling back to blank structure.`);
mobiledoc = converters.mobiledocConverter.blankStructure();