diff --git a/lib/integrations/openai_base_service.rb b/lib/integrations/openai_base_service.rb index 5a1bae2d0..1e8b42485 100644 --- a/lib/integrations/openai_base_service.rb +++ b/lib/integrations/openai_base_service.rb @@ -50,7 +50,10 @@ class Integrations::OpenaiBaseService JSON.parse(value, symbolize_names: true) rescue JSON::ParserError - value + # If json parse failed, returning the value as is will fail too + # since we access the keys as symbols down the line + # So it's best to return nil + nil end def save_to_cache(response)