MOBILE-2512 workshop: Avoid error when downloading profiles in workshop

main
Dani Palou 2018-07-19 12:14:20 +02:00
parent 204a1ce8f1
commit 424f5e324f
2 changed files with 7 additions and 1 deletions

View File

@ -363,7 +363,9 @@ export class AddonModWorkshopPrefetchHandler extends CoreCourseActivityPrefetchH
}); });
}).then(() => { }).then(() => {
// Prefetch user profiles. // Prefetch user profiles.
return this.userProvider.prefetchProfiles(userIds, courseId, siteId); return this.userProvider.prefetchProfiles(userIds, courseId, siteId).catch(() => {
// Ignore errors.
});
}); });
} }
} }

View File

@ -383,6 +383,10 @@ export class CoreUserProvider {
promises = []; promises = [];
userIds.forEach((userId) => { userIds.forEach((userId) => {
if (userId === null) {
return;
}
userId = Number(userId); // Make sure it's a number. userId = Number(userId); // Make sure it's a number.
// Prevent repeats and errors. // Prevent repeats and errors.