fix: fix nullable problems found via AttachmentViewer test

This commit is contained in:
rugk
2026-03-19 17:03:09 +00:00
parent 784f381e28
commit e094c39186

View File

@@ -2987,8 +2987,10 @@ window.PrivateBin = (function () {
me.hideAttachment();
me.hideAttachmentPreview();
attachment.innerHTML = '';
attachmentPreview.innerHTML = '';
dragAndDropFileNames.innerHTML = '';
if (attachmentPreview) {
attachmentPreview.innerHTML = '';
}
me.clearDragAndDrop();
AttachmentViewer.removeAttachmentData();
};
@@ -3027,7 +3029,7 @@ window.PrivateBin = (function () {
* @param {string[]} fileNames
*/
function printDragAndDropFileNames(fileNames) {
dragAndDropFileNames.innerHTML = '';
me.clearDragAndDrop();
fileNames.forEach(fileName => {
const name = document.createTextNode(fileName);
dragAndDropFileNames.appendChild(name);