Fix #4663: Tag script mode sometimes adds "null" tag.

This commit is contained in:
evazion
2021-01-11 19:27:10 -06:00
parent c1b865b160
commit a698ca2b8c
2 changed files with 2 additions and 1 deletions

View File

@@ -444,6 +444,7 @@ Post.show_pending_update_notice = function() {
}
Post.tag = function(post_id, tags) {
tags ??= "";
const tag_string = (Array.isArray(tags) ? tags.join(" ") : String(tags));
Post.update(post_id, "tag-script", { post: { old_tag_string: "", tag_string: tag_string }});
}