Skip to content

Commit

Permalink
bugfix #32: Add string type check to measurement enum checks
Browse files Browse the repository at this point in the history
  • Loading branch information
electrikmilk committed Dec 3, 2023
1 parent f795ee8 commit 3fca9db
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions actions_std.go
Original file line number Diff line number Diff line change
Expand Up @@ -4865,8 +4865,14 @@ func webActions() {
},
},
check: func(args []actionArgument) {
var value = getArgValue(args[1])
if reflect.TypeOf(value).String() != "string" {
return
}

makeMeasurementUnits()
var unitType = getArgValue(args[1]).(string)

var unitType = value.(string)
checkEnum(parameterDefinition{
name: "measurement unit",
enum: units[unitType],
Expand Down Expand Up @@ -4905,8 +4911,14 @@ func webActions() {
},
},
check: func(args []actionArgument) {
var value = getArgValue(args[1])
if reflect.TypeOf(value).String() != "string" {
return
}

makeMeasurementUnits()
var unitType = getArgValue(args[1]).(string)

var unitType = value.(string)
checkEnum(parameterDefinition{
name: "unit",
enum: units[unitType],
Expand Down

0 comments on commit 3fca9db

Please sign in to comment.