This commit is contained in:
Hauke Klement
2015-03-12 19:07:58 +01:00
parent f794e0a845
commit 58da5d5d66

View File

@ -61,7 +61,7 @@ module CodeOcean
private :content_present?
def hash_content
self.hashed_content = Digest::MD5.new.hexdigest(file_type.binary? ? ::File.new(native_file.file.path, 'r').read : content)
self.hashed_content = Digest::MD5.new.hexdigest(file_type.try(:binary?) ? ::File.new(native_file.file.path, 'r').read : content)
end
private :hash_content