Skip to content

Commit

Permalink
fix ch10/sem crashing when input is blank (#48)
Browse files Browse the repository at this point in the history
fix index out of range error
  • Loading branch information
angelajt authored Dec 20, 2024
1 parent 1720349 commit caf53a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ch10/sem/sem_env.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ func (ev *SemEnv) Action(element string, input tensor.Tensor) {
// String returns the string rep of the LED env state
func (ev *SemEnv) String() string {
cpar := ev.CurPara()
if cpar == nil {
if len(cpar) == 0 {
return ""
}
str := cpar[0]
Expand Down

0 comments on commit caf53a9

Please sign in to comment.