From 20f736aa112145efa3f09b6ab120904e2faa1b90 Mon Sep 17 00:00:00 2001 From: Osama Sayegh Date: Wed, 1 Dec 2021 19:57:36 +0300 Subject: [PATCH] FIX: Skip themes that have blank URL in the `themes:update` rake task (#15156) Themes that are imported via a ZIP file do have a `remote_theme` record in the database but the record has a blank value for the `remote_url` field which means attempting to do an update git via will result in an error. --- lib/tasks/themes.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tasks/themes.rake b/lib/tasks/themes.rake index 5dbcae6367c..34893c8f29f 100644 --- a/lib/tasks/themes.rake +++ b/lib/tasks/themes.rake @@ -56,7 +56,7 @@ def update_themes Theme.includes(:remote_theme).where(enabled: true, auto_update: true).find_each do |theme| begin remote_theme = theme.remote_theme - next if remote_theme.blank? + next if remote_theme.blank? || remote_theme.remote_url.blank? puts "Updating '#{theme.name}' for '#{RailsMultisite::ConnectionManagement.current_db}'..." remote_theme.update_from_remote