Permalink
Browse files

Only return version url if version exists

  • Loading branch information...
1 parent 634d9fa commit 2582999e83cde4b0ba3fdf4b132b1c8410502eb1 @tmaier tmaier committed May 18, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/carrierwave/uploader/versions.rb
@@ -180,7 +180,7 @@ def url(*args)
if (version = args.first) && version.respond_to?(:to_sym)
raise ArgumentError, "Version #{version} doesn't exist!" if versions[version.to_sym].nil?
# recursively proxy to version
- versions[version.to_sym].url(*args[1..-1])
+ versions[version.to_sym].url(*args[1..-1]) if version_exists?(version)
elsif args.first
super(args.first)
else

0 comments on commit 2582999

Please sign in to comment.