Skip to content

Commit

Permalink
fix: possible NRE
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinZonda committed May 8, 2023
1 parent d2a0894 commit 0e8e487
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 7 deletions.
3 changes: 2 additions & 1 deletion variable/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ func typeFactory(varType string, name string) interfaces.Variable {
case "float":
return types.NewFloat(name)
default:
return nil
// FIXME: cannot parse this type!
return types.NewString(name)
}
}

Expand Down
1 change: 0 additions & 1 deletion variable/types/float.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (

type FloatType struct {
BaseType
value float64
}

func (i *FloatType) SetValue(s string) bool {
Expand Down
1 change: 0 additions & 1 deletion variable/types/int.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (

type IntType struct {
BaseType
value int64
}

func (i *IntType) SetValue(s string) bool {
Expand Down
5 changes: 1 addition & 4 deletions variable/types/string.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ import (

type StringType struct {
BaseType
name string
constraint interfaces.Constraint
value string
hasVal bool
name string
}

func (s *StringType) SetValue(s2 string) bool {
Expand Down

0 comments on commit 0e8e487

Please sign in to comment.