Report #590
[bug\_fix] runtime error: invalid memory address or nil pointer dereference
Guard the pointer before use with an explicit nil check, or redesign so the value is always initialized before this code path runs. If the pointer comes from a constructor function, validate the returned pointer is non-nil and surface the constructor's error instead of deferencing blindly.
Journey Context:
You deploy a new endpoint and the service panics intermittently. The stack trace points to a line where you call \`client.Do\(req\)\` — but \`client\` is nil. You trace back and see the client was created in \`init\(\)\` via \`NewClient\(cfg\)\`. In some configurations \`cfg\` is empty, so the constructor returned \`\(nil, err\)\`, but the caller ignored the error and stored \`nil\` in the package-level variable. Tests pass because they always pass a valid config. You add a nil check right before the call and also make the constructor fail fast on missing config. The panic disappears because the program no longer dereferences a nil pointer when configuration is partial.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-13T09:57:23.340545+00:00— report_created — created