From e791f6e7fd03d016df70637f6a33d8868d9789cb Mon Sep 17 00:00:00 2001 From: swayangjit Date: Tue, 3 Sep 2019 23:14:14 +0530 Subject: [PATCH] Issue #SB-14580 fix : INTERACT event is generating after 0 search result. --- src/pages/search/search.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/search/search.ts b/src/pages/search/search.ts index 2c38d08d3..4e3778bb3 100644 --- a/src/pages/search/search.ts +++ b/src/pages/search/search.ts @@ -739,7 +739,7 @@ export class SearchPage implements OnInit, OnDestroy { this.generateLogEvent(response); const values = new Map(); values['from'] = this.source; - values['searchCount'] = this.searchContentResult.length; + values['searchCount'] = this.searchContentResult ? this.searchContentResult.length : 0; values['searchCriteria'] = response.request; this.telemetryGeneratorService.generateExtraInfoTelemetry(values, PageId.SEARCH); } else { @@ -1462,7 +1462,7 @@ export class SearchPage implements OnInit, OnDestroy { const contentArray: Array = searchResult.contentDataList; const params = new Array(); const paramsMap = new Map(); - paramsMap['SearchResults'] = contentArray.length; + paramsMap['SearchResults'] = contentArray ? contentArray.length : 0; paramsMap['SearchCriteria'] = searchResult.request; params.push(paramsMap); this.telemetryGeneratorService.generateLogEvent(LogLevel.INFO,