Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Fix team planner crash when adding a wp from the add existing pane

Benjamin Bädorfcd03015486ea
diff --git a/frontend/src/app/shared/components/principal/principal.component.ts b/frontend/src/app/shared/components/principal/principal.component.ts
index d86101a74ac..5d6bdaa3002 100644
--- a/frontend/src/app/shared/components/principal/principal.component.ts
+++ b/frontend/src/app/shared/components/principal/principal.component.ts
@@ -45,6 +45,7 @@ import {
import { PrincipalLike } from './principal-types';
import { DatasetInputs } from 'core-app/shared/components/dataset-inputs.decorator';
import { PrincipalType } from 'core-app/shared/components/principal/principal-helper';
+import { PrincipalsResourceService } from 'core-app/core/state/principals/principals.service';
export const principalSelector = 'op-principal';
@@ -70,16 +71,21 @@ export class OpPrincipalComponent implements OnInit {
@Input() size:AvatarSize = 'default';
- public constructor(readonly elementRef:ElementRef,
+ public constructor(
+ readonly elementRef:ElementRef,
readonly PathHelper:PathHelperService,
readonly principalRenderer:PrincipalRendererService,
+ readonly principalResourceService:PrincipalsResourceService,
readonly I18n:I18nService,
readonly apiV3Service:ApiV3Service,
- readonly timezoneService:TimezoneService) {
-
- }
+ readonly timezoneService:TimezoneService,
+ ) { }
ngOnInit() {
+ if (!this.principal.name) {
+ return;
+ }
+
this.principalRenderer.render(
this.elementRef.nativeElement as HTMLElement,
this.principal,