From b84c4af63a54824e8dcee095266ce8d16cfd4525 Mon Sep 17 00:00:00 2001 From: chiu Date: Wed, 26 Feb 2020 19:34:55 +0800 Subject: [PATCH] fix error --- app/controllers/admin/galleries_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/admin/galleries_controller.rb b/app/controllers/admin/galleries_controller.rb index 01705c1..b3b60fb 100644 --- a/app/controllers/admin/galleries_controller.rb +++ b/app/controllers/admin/galleries_controller.rb @@ -271,7 +271,7 @@ class Admin::GalleriesController < OrbitAdminController def index album_length = Album.all.count album_sort = Album.all.asc(:created_at) - if album_sort.first.album_colors.first.nil? + if (album_sort.first.album_colors.first.nil? rescue false) album_sort.each_with_index do |album| if album.album_colors.first.nil? album.album_colors.create('color' => 'transparent')