Skip to content

Commit 4d2c233

Browse files
The9CatCopilot
andauthored
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 828b00a commit 4d2c233

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎utils/ICs/ParticleHDF5.H‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ namespace EXP
126126
m.push_back(p[0]); x.push_back(p[1]); y.push_back(p[2]); z.push_back(p[3]);
127127
u.push_back(p[4]); v.push_back(p[5]); w.push_back(p[6]);
128128
}
129+
if (num_aux_ints < 0 || num_aux_floats < 0)
130+
throw std::invalid_argument("auxiliary field counts must be non-negative");
129131
std::vector<std::vector<int>> auxi(num_aux_ints, std::vector<int>(particles.size(), 0));
130132
std::vector<std::vector<T>> auxf(num_aux_floats, std::vector<T>(particles.size(), 0));
131133
write(filename, m, x, y, z, u, v, w, auxi, auxf, std::nullopt, filter);

0 commit comments

Comments
 (0)