Skip to content

Commit

Permalink
removed leftover debug trace, fixed a panic bug
Browse files Browse the repository at this point in the history
  • Loading branch information
adnanh committed Mar 21, 2015
1 parent baec1ca commit 231426d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 6 additions & 2 deletions hook/hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,12 @@ func GetParameter(s string, params interface{}) (interface{}, bool) {
}

if p := strings.SplitN(s, ".", 2); len(p) > 1 {
if pValue, ok := params.(map[string]interface{})[p[0]]; ok {
return GetParameter(p[1], pValue)
if paramsValue := reflect.ValueOf(params); paramsValue.Kind() == reflect.Map {
if pValue, ok := params.(map[string]interface{})[p[0]]; ok {
return GetParameter(p[1], pValue)
}
} else {
return nil, false
}
} else {
if pValue, ok := params.(map[string]interface{})[p[0]]; ok {
Expand Down
2 changes: 0 additions & 2 deletions webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,6 @@ func hookHandler(w http.ResponseWriter, r *http.Request) {

hook.ParseJSONParameters(&headers, &query, &payload)

fmt.Printf("%+v", payload)

// handle hook
go handleHook(hook, &headers, &query, &payload, &body)

Expand Down

0 comments on commit 231426d

Please sign in to comment.