Skip to content

Commit

Permalink
fix: make Slice and Map work on empty request
Browse files Browse the repository at this point in the history
  • Loading branch information
vmihailenco committed Oct 14, 2021
1 parent 1f521b9 commit 609c7a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions request.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ func (ps Params) Int64(name string) (int64, error) {
}

func (ps Params) Map() map[string]string {
if len(ps.node.params) == 0 {
if ps.node == nil || len(ps.node.params) == 0 {
return nil
}
m := make(map[string]string, len(ps.node.params))
Expand All @@ -185,7 +185,7 @@ type Param struct {
}

func (ps Params) Slice() []Param {
if len(ps.node.params) == 0 {
if ps.node == nil || len(ps.node.params) == 0 {
return nil
}
slice := make([]Param, len(ps.node.params))
Expand Down

0 comments on commit 609c7a3

Please sign in to comment.