From 0df0b0675f2370cada14d4df73e23c0bcdec8f25 Mon Sep 17 00:00:00 2001
From: RIHTARSIC Joze <joze.rihtarsic@ext.ec.europa.eu>
Date: Tue, 13 Jun 2023 06:26:44 +0200
Subject: [PATCH] Fixed double click error on search table

---
 .../src/app/common/search-table/search-table.component.ts   | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/smp-angular/src/app/common/search-table/search-table.component.ts b/smp-angular/src/app/common/search-table/search-table.component.ts
index 6f498c3eb..da0bdc364 100644
--- a/smp-angular/src/app/common/search-table/search-table.component.ts
+++ b/smp-angular/src/app/common/search-table/search-table.component.ts
@@ -260,6 +260,9 @@ export class SearchTableComponent implements OnInit {
     const formRef: MatDialogRef<any> = this.searchTableController.newDialog({
       data: {edit: false}
     });
+    if (!formRef) {
+      return;
+    }
     formRef.afterClosed().subscribe(result => {
       if (result) {
         this.rows = [...this.rows, {...formRef.componentInstance.getCurrent()}];
@@ -387,6 +390,9 @@ export class SearchTableComponent implements OnInit {
     const formRef: MatDialogRef<any> = this.searchTableController.newDialog({
       data: {edit: row?.status!=EntityStatus.NEW, row}
     });
+    if (!formRef) {
+      return;
+    }
     formRef.afterClosed().subscribe(result => {
       if (result) {
         const changed = this.searchTableController.isRecordChanged(row, formRef.componentInstance.getCurrent());
-- 
GitLab