From 54746353611fdde339dcb2001948a72c2d8da56c Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 16 Mar 2018 11:19:06 +1100 Subject: [PATCH] add more safety --- app/models/remote_theme.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/remote_theme.rb b/app/models/remote_theme.rb index f7b65bddebd..f817a090a7a 100644 --- a/app/models/remote_theme.rb +++ b/app/models/remote_theme.rb @@ -156,7 +156,7 @@ class RemoteTheme < ActiveRecord::Base def update_theme_color_schemes(theme, schemes) missing_scheme_names = Hash[*theme.color_schemes.pluck(:name, :id).flatten] - schemes.each do |name, colors| + schemes&.each do |name, colors| missing_scheme_names.delete(name) existing = theme.color_schemes.find_by(name: name) if existing