Skip to content

Conversation

@naitoh
Copy link
Contributor

@naitoh naitoh commented Sep 20, 2025

Why?

> require 'rexml/parsers/sax2parser'
> REXML::Parsers::SAX2Parser.new("<a><b></b></a>").parse
lib/rexml/parsers/sax2parser.rb:263:in 'REXML::Parsers::SAX2Parser#get_namespace': undefined method '[]' for nil (NoMethodError)

        current_namespace[prefix] || current_namespace[nil]
                         ^^^^^^^^
	from lib/rexml/parsers/sax2parser.rb:150:in 'REXML::Parsers::SAX2Parser#parse'

…out specifying `#listen`

```
> require 'rexml/parsers/sax2parser'
> REXML::Parsers::SAX2Parser.new("<a><b></b></a>").parse
lib/rexml/parsers/sax2parser.rb:263:in 'REXML::Parsers::SAX2Parser#get_namespace': undefined method '[]' for nil (NoMethodError)

        current_namespace[prefix] || current_namespace[nil]
                         ^^^^^^^^
	from lib/rexml/parsers/sax2parser.rb:150:in 'REXML::Parsers::SAX2Parser#parse'
```
@naitoh naitoh requested a review from kou September 20, 2025 23:55
Copy link
Member

@kou kou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@kou kou merged commit aae683c into ruby:master Sep 21, 2025
66 of 67 checks passed
@naitoh naitoh deleted the fix_get_namespace_sax branch September 21, 2025 06:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants