From 613c79ab31e6097b9705762350078b97cf6ecaef Mon Sep 17 00:00:00 2001 From: Emilio Blanco Date: Fri, 1 Apr 2011 08:00:05 -0300 Subject: [PATCH] Fix: Try to add empty attachment --- app/controllers/webmail_controller.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/controllers/webmail_controller.rb b/app/controllers/webmail_controller.rb index 9936114..565d8be 100644 --- a/app/controllers/webmail_controller.rb +++ b/app/controllers/webmail_controller.rb @@ -139,8 +139,10 @@ class WebmailController < ApplicationController render :action => :mailsent elsif operation == t(:add) @mail = create_mail - attachment = CDF::Attachment.new(@mail) - attachment.file = params['attachment'] + if params['attachment'] + attachment = CDF::Attachment.new(@mail) + attachment.file = params['attachment'] + end else # default - new email create @mail = create_mail