Skip to content

Commit 4cdfad2

Browse files
authored
Merge pull request #565 from SCIInstitute/fix_studio
Fix crash where blank studio project has initial data added.
2 parents ee726f8 + 4d8614b commit 4cdfad2

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Libs/Project/Project.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,10 +250,12 @@ void Project::store_subjects()
250250

251251
// groomed files
252252
auto groomed_files = subject->get_groomed_filenames();
253-
while (groomed_files.size() > groomed_columns.size()) {
254-
groomed_columns.push_back(std::string(GROOMED_PREFIX) + "file");
253+
if (groomed_files.size() >= groomed_columns.size()) {
254+
while (groomed_files.size() > groomed_columns.size()) {
255+
groomed_columns.push_back(std::string(GROOMED_PREFIX) + "file");
256+
}
257+
this->set_list(groomed_columns, i, groomed_files);
255258
}
256-
this->set_list(groomed_columns, i, groomed_files);
257259

258260
// local files
259261
std::string local_filename = subject->get_local_particle_filename();
@@ -437,7 +439,7 @@ std::vector<std::string> Project::get_list(std::vector<std::string> columns, int
437439
void Project::set_list(std::vector<std::string> columns, int subject,
438440
std::vector<std::string> values)
439441
{
440-
442+
assert(columns.size() == values.size());
441443
for (int s = 0; s < columns.size(); s++) {
442444
auto column = columns[s];
443445
int column_index = get_index_for_column(column, true);

0 commit comments

Comments
 (0)