From 3d13429b41fb7130f56f7a0fae81c38a6067fe09 Mon Sep 17 00:00:00 2001 From: Matt Robinson Date: Sat, 4 Nov 2023 22:55:55 -0400 Subject: [PATCH] empty config files shouldn't raise exception fixes #47 --- lib/sidecloq/schedule.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sidecloq/schedule.rb b/lib/sidecloq/schedule.rb index ff3d46e..66acd04 100644 --- a/lib/sidecloq/schedule.rb +++ b/lib/sidecloq/schedule.rb @@ -34,7 +34,7 @@ def self.from_redis def self.from_hash(hash) hash = hash[env] if hash.key?(env) - specs = hash.each_with_object({}) do |(name, spec), memo| + specs = (hash || []).each_with_object({}) do |(name, spec), memo| memo[name] = spec.dup.tap do |s| s['class'] = name unless spec.key?('class') || spec.key?(:class) s['args'] = s['args'] || s[:args] || []