It seems that line 78 of the parser tries to access the MatchData array even though String#match will return nil when there are no matches. The options_hash will therefore never be empty in a valid jbuilder template, meaning that the check is wrongly done.
Steps to reproduce:
Expected result:
The template is assigned to the JS
gon.foo
variable successfully.Actual result:
Exception thrown:
NoMethodError: undefined method '[]' for nil:NilClass
Stacktrace:Notes:
It seems that line 78 of the parser tries to access the
MatchData
array even thoughString#match
will returnnil
when there are no matches. Theoptions_hash
will therefore never be empty in a valid jbuilder template, meaning that the check is wrongly done.