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