MOBILE-2795 assign: Fix fetching grades when assingment has no submissions

main
Albert Gasset 2019-01-08 12:39:19 +01:00
parent 8ae36fc8f4
commit c8b3501339
1 changed files with 5 additions and 0 deletions

View File

@ -269,6 +269,11 @@ export class AddonModAssignProvider {
return assignment.grades;
}
} else if (response.warnings && response.warnings.length) {
if (response.warnings[0].warningcode == 3) {
// No grades found.
return [];
}
return Promise.reject(response.warnings[0]);
}