Skip to content

Commit

Permalink
Merge pull request #140 from projectdiscovery/updater-bug-fix
Browse files Browse the repository at this point in the history
fix panic on err and version empty
  • Loading branch information
Mzack9999 committed Apr 23, 2023
2 parents 9261ad8 + 16ddb8e commit 41635c6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion update/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,11 @@ func GetToolVersionCallback(toolName, version string) func() (string, error) {
return "", errorutil.NewWithErr(err).Msgf("failed to unmarshal %v", string(body)).WithTag("updater")
}
if toolDetails.Version == "" {
return "", errorutil.NewWithErr(err).Msgf("something went wrong, expected version string but got empty string for GET `%v`", updateURL)
msg := fmt.Sprintf("something went wrong, expected version string but got empty string for GET `%v` response `%v`", updateURL, string(body))
if err == nil {
return "", errorutil.New(msg)
}
return "", errorutil.NewWithErr(err).Msgf(msg)
}
return toolDetails.Version, nil
}
Expand Down

0 comments on commit 41635c6

Please sign in to comment.