fm-edit: deal with potential initialization sequence error
authorGalen Charlton <gmc@equinoxinitiative.org>
Tue, 1 Sep 2020 14:52:50 +0000 (10:52 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Tue, 1 Sep 2020 14:52:50 +0000 (10:52 -0400)
Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.ts

index d396ae8..8dfa4e0 100644 (file)
@@ -621,7 +621,9 @@ export class FmRecordEditorComponent
         this.pcrud[this.mode]([recToSave]).toPromise().then(
             result => {
                 this.recordSaved.emit(result);
-                this.fmEditForm.form.markAsPristine();
+                if (this.fmEditForm) {
+                    this.fmEditForm.form.markAsPristine();
+                }
                 this.successStr.current().then(msg => this.toast.success(msg));
                 if (this.isDialog()) { this.record = undefined; this.close(result); }
             },