@sinequa/assistant 3.5.0 → 3.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1436,10 +1436,12 @@ class ChatMessageComponent {
1436
1436
  for (let m of this.conversation) {
1437
1437
  if (m.additionalProperties.$attachment) {
1438
1438
  for (const attachment of m.additionalProperties.$attachment) {
1439
- this.referenceMap.set('' + attachment.contextId, { ...attachment, $partId: attachment.parts?.[0].partId });
1440
- for (let i = 0; i < attachment.parts.length; i++) {
1441
- const refId = `${attachment.contextId}.${attachment.parts[i].partId}`;
1442
- this.referenceMap.set(refId, { ...attachment, $partId: attachment.parts[i].partId });
1439
+ this.referenceMap.set('' + attachment.contextId, { ...attachment, $partId: attachment.parts?.[0]?.partId });
1440
+ if (!!attachment.parts && attachment.parts.length > 0) {
1441
+ for (let i = 0; i < attachment.parts.length; i++) {
1442
+ const refId = `${attachment.contextId}.${attachment.parts[i].partId}`;
1443
+ this.referenceMap.set(refId, { ...attachment, $partId: attachment.parts?.[i]?.partId });
1444
+ }
1443
1445
  }
1444
1446
  }
1445
1447
  }