Skip to content

Commit

Permalink
func为空会导致judge服务crash
Browse files Browse the repository at this point in the history
  • Loading branch information
missuzhang committed Jan 4, 2018
1 parent 1bb721c commit a80141f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions modules/judge/store/func.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,9 @@ func atois(s string) (ret []int, err error) {

// @str: e.g. all(#3) sum(#3) avg(#10) diff(#10)
func ParseFuncFromString(str string, operator string, rightValue float64) (fn Function, err error) {
if str == "" {
return nil, fmt.Errorf("func con't be nil!")
}
idx := strings.Index(str, "#")
args, err := atois(str[idx+1 : len(str)-1])
if err != nil {
Expand Down

0 comments on commit a80141f

Please sign in to comment.