From be4dc216a91ca5ca98c9dbeede70ea945079838e Mon Sep 17 00:00:00 2001 From: wanglinchun <123@163.com> Date: Wed, 7 Aug 2013 17:14:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E6=96=B0=E5=BB=BA=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E9=A1=B5=E9=9D=A2=E9=BB=98=E8=AE=A4LOGO=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/avatar_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/avatar_helper.rb b/app/helpers/avatar_helper.rb index c17ccadf9..abaa79504 100644 --- a/app/helpers/avatar_helper.rb +++ b/app/helpers/avatar_helper.rb @@ -34,7 +34,7 @@ module AvatarHelper if source.nil? return File.join(relative_path,'AnonymousUser','0') end - if File.exist?(disk_filename(source.class,source.id)) + if source.class && source.id && File.exist?(disk_filename(source.class,source.id)) avatar_image(source) else File.join(relative_path,avatar_directory(source.class),'0')