Fix for crash when element with id 'description' was not found

This commit is contained in:
Francesco Siddi 2017-11-08 21:18:41 +01:00
parent e01f915abf
commit 8ef89d0b53

View File

@ -165,8 +165,11 @@ $(function () {
var widget = '@[' + slug + ']\n';
if (slug) {
document.getElementById('description').value += widget;
toastr.success('Attachment appended to description');
var textarea_description = document.getElementById('description').value;
if (textarea_description) {
textarea_description.value += widget;
toastr.success('Attachment appended to description');
}
} else {
toastr.error('Slug is empty, upload something first');
}