Skip to content

Commit

Permalink
Reset instance variable only if it is defined (#1184)
Browse files Browse the repository at this point in the history
Reset the value of `@all` only if it has been defined.
  • Loading branch information
ashmaroli authored and pyrmont committed Jun 17, 2019
1 parent 004b6f4 commit 48daca1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rouge/lexer.rb
Expand Up @@ -213,7 +213,7 @@ def detectable?
# @private
def register(name, lexer)
# reset an existing list of lexers
@all = nil if @all
@all = nil if defined?(@all)
registry[name.to_s] = lexer
end

Expand Down

0 comments on commit 48daca1

Please sign in to comment.