prevent error when attachments are disabled, but paste with attachment gets displayed

This commit is contained in:
El RIDO 2022-03-13 20:18:51 +01:00
parent 5617612eb3
commit 36cb37c029
No known key found for this signature in database
GPG key ID: 0F5C940A6BD81F92
4 changed files with 9 additions and 2 deletions

View file

@ -2816,6 +2816,9 @@ jQuery.PrivateBin = (function($, RawDeflate) {
*/
me.setAttachment = function(attachmentData, fileName)
{
// skip, if attachments got disabled
if (!$attachmentLink || !$attachmentPreview) return;
// data URI format: data:[<mimeType>][;base64],<data>
// position in data URI string of where data begins
@ -2859,6 +2862,9 @@ jQuery.PrivateBin = (function($, RawDeflate) {
*/
me.showAttachment = function()
{
// skip, if attachments got disabled
if (!$attachment || !$attachmentPreview) return;
$attachment.removeClass('hidden');
if (attachmentHasPreview) {