Update slug.md (#8554)

The lack of if statement generates runtime errors when following this guide.

Signed-off-by: Walsker <walsker@walwal.me>
This commit is contained in:
Wal Wal 2020-11-03 15:39:02 -05:00 committed by GitHub
parent 7ab05639ed
commit dc6c513290
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -70,7 +70,9 @@ module.exports = {
}
},
beforeUpdate: async (params, data) => {
data.slug = slugify(data.title);
if (data.title) {
data.slug = slugify(data.title);
}
},
},
};