Merge pull request #1746 from dpalou/MOBILE-2844

MOBILE-2844 assign: Fix prefetch error if grader was -1
main
Juan Leyva 2019-02-04 15:11:44 +01:00 committed by GitHub
commit 688d7a246c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -392,7 +392,7 @@ export class AddonModAssignPrefetchHandler extends CoreCourseActivityPrefetchHan
// Prefetch feedback.
if (submission.feedback) {
// Get profile and image of the grader.
if (submission.feedback.grade && submission.feedback.grade.grader) {
if (submission.feedback.grade && submission.feedback.grade.grader && submission.feedback.grade.grader != -1) {
userIds.push(submission.feedback.grade.grader);
}

View File

@ -397,7 +397,7 @@ export class CoreUserProvider {
userId = Number(userId); // Make sure it's a number.
// Prevent repeats and errors.
if (!isNaN(userId) && !treated[userId]) {
if (!isNaN(userId) && !treated[userId] && userId > 0) {
treated[userId] = true;
promises.push(this.getProfile(userId, courseId, false, siteId).then((profile) => {