From 3582a5622cb0d05a053c00c79c401fe436650fda Mon Sep 17 00:00:00 2001 From: Avisheet Srivastava <59338120+Avisheet@users.noreply.github.com> Date: Wed, 6 Mar 2024 14:12:00 +0530 Subject: [PATCH] Update src/Color.cc Co-authored-by: Addisu Z. Taddese Signed-off-by: Avisheet Srivastava <59338120+Avisheet@users.noreply.github.com> --- src/Color.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Color.cc b/src/Color.cc index 27ffc08d..725d0d70 100644 --- a/src/Color.cc +++ b/src/Color.cc @@ -205,7 +205,8 @@ float& Color::operator[](const unsigned int _index) } std::cerr << "Trying to read index " << _index << " of Color" << std::endl; - throw std::runtime_error("Index Error: Color index out of range"); + static float invalidValue = NAN_F; + return invalidValue; } //////////////////////////////////////////////////