Skip to content

Commit

Permalink
fix possible nil panic
Browse files Browse the repository at this point in the history
  • Loading branch information
tarunKoyalwar committed Jul 31, 2024
1 parent 0c325b1 commit 85d38fd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/js/compiler/compiler.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ func (c *Compiler) ExecuteWithOptions(program *goja.Program, args *ExecuteArgs,
})
if err != nil {
if val, ok := err.(*goja.Exception); ok {
err = val.Unwrap()
if x := val.Unwrap(); x != nil {
err = x
}
}
e := NewExecuteResult()
e["error"] = err.Error()
Expand Down

0 comments on commit 85d38fd

Please sign in to comment.