diff --git a/frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.component.ts b/frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.component.ts index 6959e9f2e..53438a18d 100644 --- a/frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.component.ts +++ b/frontend/src/app/ui/plan/plan-editor-blueprint/plan-editor.component.ts @@ -210,14 +210,17 @@ export class PlanEditorComponent extends BaseEditor imple super.ngOnInit(); if (this.isNew === false && this.step === 0) this.nextStep(); - this.formAnnotationService.init(this.item.id, AnnotationEntityType.Plan); - this.formAnnotationService.getAnnotationCountObservable().pipe(takeUntil(this._destroyed)).subscribe((annotationsPerAnchor: Map) => { - this.annotationsPerAnchor = annotationsPerAnchor; - }); - this.formAnnotationService.getOpenAnnotationSubjectObservable().pipe(takeUntil(this._destroyed)).subscribe((anchorId: string) => { - if (anchorId && anchorId == this.item.id?.toString()) this.showAnnotations(anchorId); - }); + if(this.item?.id){ + this.formAnnotationService.init(this.item.id, AnnotationEntityType.Plan); + this.formAnnotationService.getAnnotationCountObservable().pipe(takeUntil(this._destroyed)).subscribe((annotationsPerAnchor: Map) => { + this.annotationsPerAnchor = annotationsPerAnchor; + }); + + this.formAnnotationService.getOpenAnnotationSubjectObservable().pipe(takeUntil(this._destroyed)).subscribe((anchorId: string) => { + if (anchorId && anchorId == this.item.id?.toString()) this.showAnnotations(anchorId); + }); + } } ngAfterViewInit(): void {