Skip to content

EspoCRM – Open Source CRM Application

Stream post attachment filter null

Yuriidf8e3d29ffb6
diff --git a/client/src/views/stream/panel.js b/client/src/views/stream/panel.js
index 48a49d13c0..3cbf210d7f 100644
--- a/client/src/views/stream/panel.js
+++ b/client/src/views/stream/panel.js
@@ -392,7 +392,10 @@ class PanelStreamView extends RelationshipPanelView {
}
}
- const attachmentIdList = this.seed.get('attachmentsIds') || [];
+ /** @type {string[]} */
+ const attachmentIdList = (this.seed.get('attachmentsIds') ?? [])
+ // Null items are possible if error occurred.
+ .filter(it => it != null);
if (attachmentIdList.length) {
this.getSessionStorage().set(this.storageAttachmentsKey, {
@@ -402,8 +405,7 @@ class PanelStreamView extends RelationshipPanelView {
});
isNotEmpty = true;
- }
- else {
+ } else {
if (this.hasStoredAttachments) {
this.getSessionStorage().clear(this.storageAttachmentsKey);
}