diff --git a/app/helpers/avatar_helper.rb b/app/helpers/avatar_helper.rb index c17ccadf..abaa7950 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')