Skip to content

Commit 97fd4b2

Browse files
committed
added more checks
1 parent 6acad6a commit 97fd4b2

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

dist/breinify-recommendations.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,7 +1009,7 @@
10091009
_applyBreinifyTags: function (activityTags, recommendationData, recommendation, additionalEventData) {
10101010

10111011
// set the widgetPosition and the type (if possible)
1012-
if (typeof recommendation.widgetPosition === 'number') {
1012+
if (typeof recommendation?.widgetPosition === 'number') {
10131013
activityTags.widgetPosition = recommendation.widgetPosition;
10141014

10151015
if (typeof activityTags.widgetType === 'string') {
@@ -1020,7 +1020,7 @@
10201020
const type = Breinify.UTL.isNonEmptyString(recommendationData?.meta?.type);
10211021
activityTags.recType = type;
10221022

1023-
const id = Breinify.UTL.isNonEmptyString(recommendation.id);
1023+
const id = Breinify.UTL.isNonEmptyString(recommendation?.id);
10241024
if (id === null) {
10251025
// nothing more to do
10261026
} else if (type === 'com.brein.common.dto.CustomerAssetsDto') {

0 commit comments

Comments
 (0)