Skip to content
This repository
Browse code

Handle a nil logger when generating Deprecation warnings

  • Loading branch information...
commit 93085a7d6cd05c50a982f5beca94d7072208374c 1 parent a942d66
Michael Koziarski authored November 19, 2009
2  activesupport/lib/active_support/deprecation.rb
@@ -13,7 +13,7 @@ module Deprecation #:nodoc:
13 13
                          $stderr.puts callstack.join("\n  ") if debug
14 14
                        },
15 15
       'development' => Proc.new { |message, callstack|
16  
-                         logger = defined?(Rails) ? Rails.logger : Logger.new($stderr)
  16
+                         logger = (defined?(Rails) && Rails.logger) ? Rails.logger : Logger.new($stderr)
17 17
                          logger.warn message
18 18
                          logger.debug callstack.join("\n  ") if debug
19 19
                        }

0 notes on commit 93085a7

Please sign in to comment.
Something went wrong with that request. Please try again.