fix: don't assume that list of IDs to fetch and list of fetched objects are the same length (#4322)
This commit is contained in:
parent
dc8bb8fe8c
commit
7348024bf7
1 changed files with 3 additions and 2 deletions
|
|
@ -60,8 +60,9 @@ class CourseLocationRepo {
|
|||
if (toFetch.isNotEmpty) {
|
||||
final fetchedLocations = await _fetch(courseId, toFetch);
|
||||
locations.addAll(fetchedLocations);
|
||||
for (int i = 0; i < toFetch.length; i++) {
|
||||
await _setCached(toFetch[i], fetchedLocations[i]);
|
||||
for (int i = 0; i < fetchedLocations.length; i++) {
|
||||
final location = fetchedLocations[i];
|
||||
await _setCached(location.uuid, location);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue