Skip to content

Commit 9cc75dc

Browse files
author
nicola74
committed
Fixes the bug: the app crashes if the "feature token" environment key is missing
1 parent c189792 commit 9cc75dc

1 file changed

Lines changed: 20 additions & 17 deletions

File tree

src/app/pages/conversation-detail/conversation-detail.page.ts

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -247,30 +247,33 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
247247

248248
getOSCODE() {
249249
this.public_Key = this.appConfigProvider.getConfig().t2y12PruGU9wUtEGzBJfolMIgK;
250-
this.logger.log('[CONVS-DETAIL] AppConfigService getAppConfig public_Key', this.public_Key);
250+
console.log('[CONVS-DETAIL] AppConfigService getAppConfig public_Key', this.public_Key);
251+
if (this.public_Key) {
252+
let keys = this.public_Key.split("-");
253+
this.logger.log('[CONVS-DETAIL] PUBLIC-KEY - public_Key keys', keys)
251254

252-
let keys = this.public_Key.split("-");
253-
this.logger.log('[CONVS-DETAIL] PUBLIC-KEY - public_Key keys', keys)
255+
keys.forEach(key => {
254256

255-
keys.forEach(key => {
256257

257-
258-
if (key.includes("CAR")) {
259-
let car = key.split(":");
260-
if (car[1] === "F") {
261-
this.areVisibleCAR = false;
262-
this.logger.log('[CONVS-DETAIL] PUBLIC-KEY - areVisibleCAR', this.areVisibleCAR)
263-
} else {
264-
this.areVisibleCAR = true;
265-
this.logger.log('[CONVS-DETAIL] PUBLIC-KEY - areVisibleCAR', this.areVisibleCAR)
258+
if (key.includes("CAR")) {
259+
let car = key.split(":");
260+
if (car[1] === "F") {
261+
this.areVisibleCAR = false;
262+
this.logger.log('[CONVS-DETAIL] PUBLIC-KEY - areVisibleCAR', this.areVisibleCAR)
263+
} else {
264+
this.areVisibleCAR = true;
265+
this.logger.log('[CONVS-DETAIL] PUBLIC-KEY - areVisibleCAR', this.areVisibleCAR)
266+
}
266267
}
267-
}
268268

269-
});
269+
});
270270

271-
if (!this.public_Key.includes("CAR")) {
271+
if (!this.public_Key.includes("CAR")) {
272+
this.areVisibleCAR = false;
273+
this.logger.log('[CONVS-DETAIL] PUBLIC-KEY - areVisibleCAR', this.areVisibleCAR)
274+
}
275+
} else if (this.public_Key === undefined) {
272276
this.areVisibleCAR = false;
273-
this.logger.log('[CONVS-DETAIL] PUBLIC-KEY - areVisibleCAR', this.areVisibleCAR)
274277
}
275278
}
276279

0 commit comments

Comments
 (0)