Skip to content

Commit 92716f8

Browse files
zenspiderAle Paredes
authored and
Ale Paredes
committed
Fixed a nil exception when an empty file gets parsed as s(:_unknown). (#315)
Who knew? 🤷
1 parent 74920f5 commit 92716f8

File tree

1 file changed

+2
-0
lines changed
  • lib/cc/engine/analyzers/javascript

1 file changed

+2
-0
lines changed

lib/cc/engine/analyzers/javascript/main.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ def use_sexp_lines?
3636
# => s(:NUKE, s(:Program, :module, s(:NUKE, ... )))
3737

3838
def transform_sexp(sexp)
39+
return sexp unless sexp.body
40+
3941
sexp.body.sexp_type = :NUKE # negate top level body
4042
sexp = s(:NUKE, sexp) # wrap with extra node to force full process
4143

0 commit comments

Comments
 (0)