Skip to content

Commit ea32ca5

Browse files
authored
Merge pull request #231 from Sambruk/bugfix/208
Bugfix/208
2 parents 4b5251d + 2354a08 commit ea32ca5

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
- Space for the cache file is now pre-allocated before SCIM operations start (#197)
88

99
#### Bugfixes
10+
- Fixed an access violation which could occur when generating activities if no groups had been loaded (#208)
1011
- When using the --rebuild-cache feature, a failure to GET objects will now terminate the client (#205)
1112

1213
## v2.18 (2024-11-19)

src/generated_load.cpp

+5-2
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,10 @@ std::shared_ptr<object_list> get_generated_activity(const std::string &type,
190190

191191
data_server &server = data_server::instance();
192192
auto student_groups = server.get_by_type(master_type);
193-
auto employments = server.get_by_type(related_type.first);
193+
194+
if (!student_groups) {
195+
student_groups = std::make_shared<object_list>();
196+
}
194197

195198
for (const auto &student_group : *student_groups) {
196199
base_object generated_object(type);
@@ -504,7 +507,7 @@ std::shared_ptr<object_list> get_generated_employment(const std::string &type,
504507
}
505508
}
506509
extras_set = true;
507-
} catch (const std::out_of_range& e) {
510+
} catch (const std::out_of_range&) {
508511
// no match in extras for this Employment object
509512
}
510513
}

0 commit comments

Comments
 (0)