Skip to content

Conversation

@tenderlove
Copy link
Member

StringScanner.new("foo").named_captures will crash because no regular expression has been set. This commit returns an empty hash if no re is set on the string scanner.

We could probably also return nil, but I'm not sure. I think an empty hash is probably right since most callers expect a hash to be returned.

`StringScanner.new("foo").named_captures` will crash because no regular
expression has been set.  This commit returns an empty hash if no re is
set on the string scanner
@tenderlove
Copy link
Member Author

lol oops. I found the same crash as #61

@tenderlove tenderlove closed this Mar 6, 2023
@hsbt hsbt deleted the fix-crash branch March 24, 2023 04:20
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