Permalink
Browse files

Fix warnings generated by using instance_variable_get on unset ivar

  • Loading branch information...
1 parent 1bc83df commit bb97448acba2b03b618985f603fcca38d8fbadff @evanphx evanphx committed Oct 6, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/rubygems/specification.rb
@@ -2456,7 +2456,7 @@ def yaml_initialize(tag, vals) # :nodoc:
def reset_nil_attributes_to_default
nil_attributes = self.class.non_nil_attributes.find_all do |name|
- instance_variable_get("@#{name}").nil?
+ !instance_variable_defined?("@#{name}") || instance_variable_get("@#{name}").nil?
end
nil_attributes.each do |attribute|

0 comments on commit bb97448

Please sign in to comment.