Skip to content

Commit 3630b84

Browse files
committed
Eliminate undefined variable warnings on Ruby 1.8.7
1 parent 7712102 commit 3630b84

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/thor/core_ext/ordered_hash.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def []=(key, value)
2828
else
2929
node = Node.new(key, value)
3030

31-
if @first.nil?
31+
if !defined?(@first) || @first.nil?
3232
@first = @last = node
3333
else
3434
node.prev = @last
@@ -68,7 +68,7 @@ def values
6868
end
6969

7070
def each
71-
return unless @first
71+
return unless defined?(@first) && @first
7272
yield [@first.key, @first.value]
7373
node = @first
7474
yield [node.key, node.value] while node = node.next # rubocop:disable AssignmentInCondition

0 commit comments

Comments
 (0)