diff --git a/server.go b/server.go index c6987c2..d7af70b 100644 --- a/server.go +++ b/server.go @@ -352,8 +352,13 @@ func ConvertInterface(from interface{}, toType reflect.Type) reflect.Value { return convslice case reflect.Bool: - val, _ := strconv.ParseBool(from.(string)) - return reflect.ValueOf(val) + if fromstr, ok := from.(string); ok { + val, _ := strconv.ParseBool(fromstr) + return reflect.ValueOf(val) + } else if frombool, ok := from.(bool); ok { + return reflect.ValueOf(frombool) + } + return reflect.ValueOf(false) case reflect.String: if toType == reflect.TypeOf(primitive.ObjectID{}) {