diff --git a/lib/ddtrace/contrib/rails/core_extensions.rb b/lib/ddtrace/contrib/rails/core_extensions.rb index 3c337a2dba..cd4839c018 100644 --- a/lib/ddtrace/contrib/rails/core_extensions.rb +++ b/lib/ddtrace/contrib/rails/core_extensions.rb @@ -336,7 +336,8 @@ def delete(*args, &block) end def self.reload_cache_store - return unless Datadog.registry[:redis].patched? + redis = Datadog.registry[:redis] + return unless redis && redis.patched? return unless defined?(::ActiveSupport::Cache::RedisStore) && defined?(::Rails.cache) &&