From 7348024bf7f172e43a3401760d11750e1c3303cb Mon Sep 17 00:00:00 2001 From: ggurdin <46800240+ggurdin@users.noreply.github.com> Date: Fri, 10 Oct 2025 10:45:09 -0400 Subject: [PATCH] fix: don't assume that list of IDs to fetch and list of fetched objects are the same length (#4322) --- lib/pangea/course_plans/course_location_repo.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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); } }