From f3f7d166d8e7a1a2e15371f2870115406e1aaac2 Mon Sep 17 00:00:00 2001 From: "U-ESCAPEE\\Mack" Date: Thu, 4 Sep 2008 12:03:29 -0400 Subject: [PATCH] Fixed problem causes by leftover backup templates ending in tilde [state:committed #969] Signed-off-by: David Heinemeier Hansson --- actionmailer/lib/action_mailer/base.rb | 2 +- .../implicitly_multipart_example.text.html.erb~ | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.html.erb~ diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index 96e514e0db3fd..bfe435550ba5b 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -466,7 +466,7 @@ def create!(method_name, *parameters) #:nodoc: template = template_root["#{mailer_name}/#{File.basename(path)}"] # Skip unless template has a multipart format - next unless template.multipart? + next unless template && template.multipart? @parts << Part.new( :content_type => template.content_type, diff --git a/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.html.erb~ b/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.html.erb~ new file mode 100644 index 0000000000000..946d99ede50e3 --- /dev/null +++ b/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.html.erb~ @@ -0,0 +1,10 @@ + + + HTML formatted message to <%= @recipient %>. + + + + + HTML formatted message to <%= @recipient %>. + +