diff options
| author | Nesswit | 2018-05-22 02:51:38 +0900 |
|---|---|---|
| committer | Marcin Kurczewski | 2018-05-21 21:41:23 +0200 |
| commit | 2bf361c64a46d575533f68f8ced88e037f887335 (patch) | |
| tree | 04f356bc6e701631ce76067a8d5b2ffe66b1691c /client/js/views/post_upload_view.js | |
| parent | d39439d549a003880933d730f80c56eaf2cf20fa (diff) | |
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.
Diffstat (limited to 'client/js/views/post_upload_view.js')
| -rw-r--r-- | client/js/views/post_upload_view.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/client/js/views/post_upload_view.js b/client/js/views/post_upload_view.js index b64fe26..b4d0c40 100644 --- a/client/js/views/post_upload_view.js +++ b/client/js/views/post_upload_view.js @@ -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')) { |