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:
parent
f024b3ebb5
commit
86e8b368b6
1 changed files with 4 additions and 0 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Reference in a new issue