client/posts: fix upload error caused by anonymous node

Anonymous node does not exist in view when a user without anonymous upload permission tries to post upload. So in this case we should check for the existence of anonymousNode first.
This commit is contained in:
Nesswit 2018-05-22 02:51:38 +09:00 committed by Marcin Kurczewski
parent d39439d549
commit 2bf361c64a

View file

@ -283,8 +283,10 @@ class PostUploadView extends events.EventTarget {
uploadable.safety = safetyNode.value;
}
uploadable.anonymous =
rowNode.querySelector('.anonymous input').checked;
const anonymousNode = rowNode.querySelector('.anonymous input:checked');
if (anonymousNode) {
uploadable.anonymous = true;
}
uploadable.flags = [];
if (rowNode.querySelector('.loop-video input:checked')) {