Throw if calling well_controls_current_distr() with -1 current index.

This commit is contained in:
Atgeirr Flø Rasmussen 2019-08-13 10:14:10 +02:00
parent 8438e84db1
commit ffeb1529e8

View File

@ -356,6 +356,8 @@ well_controls_iget_distr(const struct WellControls * ctrl, int control_index) {
const double * const double *
well_controls_get_current_distr(const struct WellControls * ctrl) { well_controls_get_current_distr(const struct WellControls * ctrl) {
if (ctrl->current < 0)
throw std::logic_error("Tried to use invalid current control < 0");
return well_controls_iget_distr( ctrl , ctrl->current ); return well_controls_iget_distr( ctrl , ctrl->current );
} }