Skip to content

Commit 9b5abe5

Browse files
Merge pull request #123 from freshworks/handle-null-cases-1
[FC-132765] Handle null case scenarios related to event data
2 parents b94af15 + 74d06c2 commit 9b5abe5

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

packages/rule-engine/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@freshworks-jaya/rule-engine",
3-
"version": "0.18.8-beta-5",
3+
"version": "0.18.8",
44
"description": "Provides methods to process rules in product events in marketplace app",
55
"repository": "[email protected]:freshdesk/jaya-lib.git",
66
"main": "lib/index.js",

packages/rule-engine/src/recommended/trigger-actions/conversation-agent-assign.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const isChangeMatching = (changedAssignee: string, assignChangeValue: string | n
1414
};
1515

1616
const isTriggerChangeMatching = (productEventData: ProductEventData, triggerAction: TriggerAction): boolean => {
17-
if (!productEventData.changes.model_changes.assigned_agent_id) {
17+
if (!productEventData.changes?.model_changes?.assigned_agent_id) {
1818
return false;
1919
}
2020

packages/rule-engine/src/recommended/trigger-actions/conversation-group-assign.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const isChangeMatching = (changedAssignee: string, assignChangeValue: string | n
1414
};
1515

1616
const isTriggerChangeMatching = (productEventData: ProductEventData, triggerAction: TriggerAction): boolean => {
17-
if (!productEventData.changes.model_changes.assigned_group_id) {
17+
if (!productEventData.changes?.model_changes?.assigned_group_id) {
1818
return false;
1919
}
2020

packages/rule-engine/src/recommended/trigger-actions/conversation-label-assign.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ const isChangeMatching = (changedAssignee: string, assignChangeValue: string | n
1515

1616
const isTriggerChangeMatching = (productEventData: ProductEventData, triggerAction: TriggerAction): boolean => {
1717
if (
18-
!productEventData.changes.model_changes.label_category_id &&
19-
!productEventData.changes.model_changes.label_subcategory_id
18+
!productEventData.changes?.model_changes?.label_category_id &&
19+
!productEventData.changes?.model_changes?.label_subcategory_id
2020
) {
2121
return false;
2222
}

0 commit comments

Comments
 (0)