diff --git a/include/openmc/plot.h b/include/openmc/plot.h index fa9ca171fd..f3e4826962 100644 --- a/include/openmc/plot.h +++ b/include/openmc/plot.h @@ -38,7 +38,9 @@ struct RGBColor { RGBColor(int r, int g, int b) : red(r), green(g), blue(b) { }; RGBColor(const std::vector &v) { - assert(v.size() == 3); + if (v.size() != 3) { + throw std::out_of_range("Incorrect vector size for RGBColor."); + } red = v[0]; green = v[1]; blue = v[2];