aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/zero/renderer.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/zero/renderer.rb b/lib/zero/renderer.rb
index 5bbb875..54d2d29 100644
--- a/lib/zero/renderer.rb
+++ b/lib/zero/renderer.rb
@@ -121,11 +121,13 @@ module Zero
# @param types [Array] the types for the template
# @return [Tilt::Template] a prepared tilt template
def template(name, types)
- types.each do |type|
- template = templates[name][type]
- unless template.nil?
- return template if template.kind_of?(Tilt::Template)
- return Tilt.new(template)
+ if templates.has_key? name
+ types.each do |type|
+ template = templates[name][type]
+ unless template.nil?
+ return template if template.kind_of?(Tilt::Template)
+ return Tilt.new(template)
+ end
end
end
raise ArgumentError.new "No template found for '#{name}'!"