bug: archive.Archive() can nil-pointer panic on SelectFirst #10
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Parent: #1
Description
In
sites/archive/archive.go:107-114:SelectFirstreturnsnilif the selector doesn't match any element (seenodes.go:15-19—First()returnsnilfor emptyNodes). If the archive.ph page layout changes or loads differently, calling.Type()on a nilNodewill cause a nil pointer panic.Same issue on line 114:
Fix
Check for nil before calling methods:
Starting work on this as part of PR 2 (also includes #11). Will add nil guards for
SelectFirst()results inarchive.goand nil check forrespindocument.go:Refresh().Work finished. PR: #33
Added nil guards for
SelectFirst()results inarchive.gobefore calling.Type()and.Click().