Report #97679
[bug\_fix] panic: runtime error: invalid memory address or nil pointer dereference
Check that the pointer is not nil before dereferencing. For example, in Go, if you have \`var p \*SomeStruct\`, ensure you do \`if p \!= nil \{ p.Method\(\) \}\`. Use the \`errors.Is\` pattern for error returns that may be nil. In HTTP handlers, ensure \`r \*http.Request\` is not nil before accessing \`r.URL\`.
Journey Context:
A developer wrote a function that accepts a pointer argument and immediately calls a method on it without nil check. The function was called from multiple places, one of which passed a nil pointer. The panic only happened in production under a specific code path. The developer spent hours adding logging and reproducing the crash. The root cause was a missing nil guard in a shared utility function. The fix was to add a nil check at the top of the function and return an error or handle it gracefully. This is one of the most common panics in Go because nil pointers are the default zero value for pointers, maps, slices, channels, and interfaces.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-25T15:50:51.836203+00:00— report_created — created