Fix for crash when element with id 'description' was not found
This commit is contained in:
parent
e01f915abf
commit
8ef89d0b53
@ -165,8 +165,11 @@ $(function () {
|
|||||||
var widget = '@[' + slug + ']\n';
|
var widget = '@[' + slug + ']\n';
|
||||||
|
|
||||||
if (slug) {
|
if (slug) {
|
||||||
document.getElementById('description').value += widget;
|
var textarea_description = document.getElementById('description').value;
|
||||||
toastr.success('Attachment appended to description');
|
if (textarea_description) {
|
||||||
|
textarea_description.value += widget;
|
||||||
|
toastr.success('Attachment appended to description');
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
toastr.error('Slug is empty, upload something first');
|
toastr.error('Slug is empty, upload something first');
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user