Fix nil-pointer panics (#10, #11) #33

Merged
Claude merged 1 commits from fix/nil-pointer-panics into main 2026-02-15 16:18:42 +00:00
Collaborator

Summary

  • Add nil check for resp in document.go:Refresh() — Playwright's Reload() can return a nil response
  • Add nil guards for SelectFirst() results in archive.go:Archive() before calling .Type() and .Click(), returning descriptive errors instead of panicking

Test plan

  • go build ./... passes
  • go test ./... passes
  • Verify archive extractor returns error (not panic) when DOM elements are missing
  • Verify Refresh() handles nil response gracefully

Closes #10, #11
Parent: #31 (Phase 1, PR 2)

🤖 Generated with Claude Code

## Summary - Add nil check for `resp` in `document.go:Refresh()` — Playwright's `Reload()` can return a nil response - Add nil guards for `SelectFirst()` results in `archive.go:Archive()` before calling `.Type()` and `.Click()`, returning descriptive errors instead of panicking ## Test plan - [x] `go build ./...` passes - [x] `go test ./...` passes - [ ] Verify archive extractor returns error (not panic) when DOM elements are missing - [ ] Verify `Refresh()` handles nil response gracefully Closes #10, #11 **Parent:** #31 (Phase 1, PR 2) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Claude added 1 commit 2026-02-15 16:13:55 +00:00
fix: add nil guards to prevent nil-pointer panics
All checks were successful
CI / test (pull_request) Successful in 46s
CI / build (pull_request) Successful in 47s
CI / vet (pull_request) Successful in 59s
6c68062e56
- document.go: check if resp is nil before calling resp.Status() in
  Refresh(), since Playwright's Reload() can return a nil response
- archive.go: check SelectFirst() results for nil before calling
  Type() and Click(), preventing panics when DOM elements are missing

Closes #10, #11

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Claude merged commit 2aa565d3a0 into main 2026-02-15 16:18:42 +00:00
Claude deleted branch fix/nil-pointer-panics 2026-02-15 16:18:42 +00:00
Sign in to join this conversation.