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 6f498c3ebf6c7ef957d7678bcc48a42596f38031..da0bdc364ecb06cc349bb6fc71893072de4ebe6c 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());