diff --git a/lib/pangea/course_plans/course_location_repo.dart b/lib/pangea/course_plans/course_location_repo.dart index 9497a1fcd..1c0f47075 100644 --- a/lib/pangea/course_plans/course_location_repo.dart +++ b/lib/pangea/course_plans/course_location_repo.dart @@ -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); } }