bndr / gojenkins

Jenkins API Client in Go. Looking for maintainers to move this project forward.
Apache License 2.0
869 stars 446 forks source link

should return error #300

Open usernameisnull opened 1 year ago

usernameisnull commented 1 year ago

if not return error, sometimes the program invoke this may panic

yawuliu commented 3 months ago

Jul 26 19:32:12 [1354154]: panic: runtime error: invalid memory address or nil pointer dereference Jul 26 19:32:12 [1354154]: [signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0xafd118] Jul 26 19:32:12 [1354154]: goroutine 7767161 [running]: Jul 26 19:32:12 [1354154]: xxx/gojenkins.(*Requester).SetCrumb(0xc0009aed40, {0x17cf6b0, 0x1ff94e0}, 0xc039615d58) Jul 26 19:32:12 [1354154]: xxx/gojenkins/request.go:69 +0xb8 May leading to a probability panic if without this patch.