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

check if the current project is not null then add it to the list of projects (#10440)

Behrokh Satarnejadcacd8a081a74
diff --git a/frontend/src/app/shared/components/project-include/project-include.component.ts b/frontend/src/app/shared/components/project-include/project-include.component.ts
index 732ec9caa04..e78bfc2b2c4 100644
--- a/frontend/src/app/shared/components/project-include/project-include.component.ts
+++ b/frontend/src/app/shared/components/project-include/project-include.component.ts
@@ -114,11 +114,11 @@ export class OpProjectIncludeComponent extends UntilDestroyedMixin {
if (selectedProjectHrefs.includes(currentProjectHref)) {
return selectedProjectHrefs;
}
-
- return [
- ...selectedProjectHrefs,
- currentProjectHref,
- ];
+ const selectedPrjects = [...selectedProjectHrefs];
+ if (currentProjectHref) {
+ selectedPrjects.push(currentProjectHref);
+ }
+ return selectedPrjects;
}),
);