From 7d1d04409e1660891604ad7d4ee9b0be57907a73 Mon Sep 17 00:00:00 2001 From: sumeyyeKurtulus Date: Mon, 6 May 2024 09:28:13 +0300 Subject: [PATCH 1/2] fix: possible undefined logic errors are mitigated --- .../components/extensible-table/extensible-table.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/npm/ng-packs/packages/components/extensible/src/lib/components/extensible-table/extensible-table.component.ts b/npm/ng-packs/packages/components/extensible/src/lib/components/extensible-table/extensible-table.component.ts index 4e60ab9851b..c7a83258c40 100644 --- a/npm/ng-packs/packages/components/extensible/src/lib/components/extensible-table/extensible-table.component.ts +++ b/npm/ng-packs/packages/components/extensible/src/lib/components/extensible-table/extensible-table.component.ts @@ -207,7 +207,7 @@ export class ExtensibleTableComponent implements OnChanges { } hasAvailableActions(index, data): boolean { - const { permission, visible } = this.actionList.get(index).value; + const { permission, visible } = (this.actionList.get(index) || {}).value || {}; let isActionAvailable = this.permissionService.getGrantedPolicy(permission); if (data && data.record) { isActionAvailable &&= visible(data); From 8e7bd55a1524bbb8b0586e44493aef0415afc149 Mon Sep 17 00:00:00 2001 From: sumeyyeKurtulus Date: Mon, 6 May 2024 10:47:32 +0300 Subject: [PATCH 2/2] fix: syntactical readibility --- .../components/extensible-table/extensible-table.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/npm/ng-packs/packages/components/extensible/src/lib/components/extensible-table/extensible-table.component.ts b/npm/ng-packs/packages/components/extensible/src/lib/components/extensible-table/extensible-table.component.ts index c7a83258c40..a99ba37907b 100644 --- a/npm/ng-packs/packages/components/extensible/src/lib/components/extensible-table/extensible-table.component.ts +++ b/npm/ng-packs/packages/components/extensible/src/lib/components/extensible-table/extensible-table.component.ts @@ -207,7 +207,7 @@ export class ExtensibleTableComponent implements OnChanges { } hasAvailableActions(index, data): boolean { - const { permission, visible } = (this.actionList.get(index) || {}).value || {}; + const { permission, visible } = this.actionList.get(index)?.value || {}; let isActionAvailable = this.permissionService.getGrantedPolicy(permission); if (data && data.record) { isActionAvailable &&= visible(data);