fix(studyPrefetcher): Avoid errors in Study Prefetcher when settings are undefined

This commit is contained in:
Erik Ziegler 2018-08-09 15:50:36 +02:00
parent 69ea0f488c
commit b8eadd6d61

View File

@ -131,7 +131,18 @@ export class StudyPrefetcher {
}
prefetchDisplaySets() {
const config = Meteor.settings.public.prefetch;
let config;
if (Meteor.settings &&
Meteor.settings.public &&
Meteor.settings.prefetch) {
config = Meteor.settings.public.prefetch;
} else {
config = {
order: 'closest',
displaySetCount: 1
};
}
const displaySetsToPrefetch = this.getDisplaySetsToPrefetch(config);
const imageIds = this.getImageIdsFromDisplaySets(displaySetsToPrefetch);