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

Prevent null access to config object

Oliver Günther706314900644
diff --git a/frontend/src/app/modules/common/config/configuration.service.ts b/frontend/src/app/modules/common/config/configuration.service.ts
index 77e55ec561d..210cc4a9c02 100644
--- a/frontend/src/app/modules/common/config/configuration.service.ts
+++ b/frontend/src/app/modules/common/config/configuration.service.ts
@@ -113,10 +113,10 @@ export class ConfigurationService {
}
private userPreference(pref:string) {
- return this.configuration.userPreferences[pref];
+ return _.get(this.configuration, ['userPreferences', pref]);
}
private systemPreference(pref:string) {
- return this.configuration[pref];
+ return _.get(this.configuration, pref);
}
}