From b5d03d0be771ec16da1845a7e709c8f57b295348 Mon Sep 17 00:00:00 2001 From: Sam Lown Date: Tue, 8 Jun 2010 00:17:43 +0200 Subject: [PATCH] Check for nil paths on MIME check --- lib/couchrest/mixins/extended_attachments.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/couchrest/mixins/extended_attachments.rb b/lib/couchrest/mixins/extended_attachments.rb index 970f678..0f928bd 100644 --- a/lib/couchrest/mixins/extended_attachments.rb +++ b/lib/couchrest/mixins/extended_attachments.rb @@ -54,6 +54,7 @@ module CouchRest private def get_mime_type(path) + return nil if path.nil? type = ::MIME::Types.type_for(path) type.empty? ? nil : type.first.content_type end