diff --git a/lib/pry/code.rb b/lib/pry/code.rb index c769d9eb..c53f7331 100644 --- a/lib/pry/code.rb +++ b/lib/pry/code.rb @@ -82,7 +82,7 @@ class Pry # @return [String, nil] The first complete expression, or `nil` if # none found. def retrieve_complete_expression_from(str_or_lines) - lines = str_or_lines.is_a?(Array) ? str_or_lines : str.each_line.to_a + lines = str_or_lines.is_a?(Array) ? str_or_lines : str_or_lines.each_line.to_a code = "" lines.each do |v| diff --git a/lib/pry/method.rb b/lib/pry/method.rb index 9ea55f65..78ef31b8 100644 --- a/lib/pry/method.rb +++ b/lib/pry/method.rb @@ -288,7 +288,7 @@ class Pry end def source_location - if Helpers::BaseHelpers.rbx? + if @method.source_location && Helpers::BaseHelpers.rbx? file, line = @method.source_location [RbxPath.convert_path_to_full(file), line] else