func(d*document)Refresh()error{resp,err:=d.page.Reload()iferr!=nil{returnfmt.Errorf("failed to reload page: %w",err)}resp.Status()// panics if resp is nil}
If Playwright's Reload() returns (nil, nil) — which can happen if the page is already navigating or in some edge cases — resp.Status() will cause a nil pointer dereference.
Fix
Add a nil check: if resp == nil { return nil } or treat nil response as an error.
**Parent:** #1
## Description
In `document.go:58-69`:
```go
func (d *document) Refresh() error {
resp, err := d.page.Reload()
if err != nil {
return fmt.Errorf("failed to reload page: %w", err)
}
resp.Status() // panics if resp is nil
}
```
If Playwright's `Reload()` returns `(nil, nil)` — which can happen if the page is already navigating or in some edge cases — `resp.Status()` will cause a nil pointer dereference.
## Fix
Add a nil check: `if resp == nil { return nil }` or treat nil response as an error.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Parent: #1
Description
In
document.go:58-69:If Playwright's
Reload()returns(nil, nil)— which can happen if the page is already navigating or in some edge cases —resp.Status()will cause a nil pointer dereference.Fix
Add a nil check:
if resp == nil { return nil }or treat nil response as an error.Starting work on this as part of PR 2 (also includes #10). Will add nil check for
respfromReload()indocument.go:Refresh().Work finished. PR: #33
Added nil check for
respfromReload()indocument.go:Refresh().Resolved by PR #33 — added nil guard for
respbefore callingresp.Status()indocument.Refresh().