From 423326d67caf087abb9bc9d08dc0ffdda7a20c0a Mon Sep 17 00:00:00 2001 From: Ruling-Mac Date: Thu, 16 Jul 2015 17:02:24 +0800 Subject: [PATCH] fix a nil class error about tag --- app/controllers/archives_controller.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/archives_controller.rb b/app/controllers/archives_controller.rb index 577e386..febc87e 100644 --- a/app/controllers/archives_controller.rb +++ b/app/controllers/archives_controller.rb @@ -38,8 +38,9 @@ class ArchivesController < ApplicationController } end { - "tag-name" => t[0].name, + "tag-name" => (t[0].name rescue ""), "archives" => archives + } end if(files_by_category_tag.empty?) @@ -91,7 +92,7 @@ class ArchivesController < ApplicationController } end { - "tag-name" => t[0].name, + "tag-name" => (t[0].name rescue ""), "archives" => archives }