add safety guard to serializers & fix importing uncorrect serializer

This commit is contained in:
otofune
2017-11-06 18:30:49 +09:00
parent 26602dcd20
commit c1fc3b9f6e
3 changed files with 5 additions and 1 deletions

View File

@@ -57,6 +57,8 @@ const self = async (
_post = deepcopy(post);
}
if (!_post) throw 'invalid post arg.';
const id = _post._id;
// Rename _id to id