Skip to content
This repository was archived by the owner on Jan 30, 2025. It is now read-only.

Commit 88b2ba9

Browse files
committed
Remove Frame and Request nil checks
1 parent ba775c9 commit 88b2ba9

File tree

2 files changed

+0
-15
lines changed

2 files changed

+0
-15
lines changed

common/frame.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,10 +1107,6 @@ func (f *Frame) IsVisible(selector string, opts goja.Value) bool {
11071107

11081108
// ID returns the frame id
11091109
func (f *Frame) ID() string {
1110-
if f == nil {
1111-
return ""
1112-
}
1113-
11141110
f.propertiesMu.RLock()
11151111
defer f.propertiesMu.RUnlock()
11161112

@@ -1119,10 +1115,6 @@ func (f *Frame) ID() string {
11191115

11201116
// LoaderID returns the ID of the frame that loaded this frame
11211117
func (f *Frame) LoaderID() string {
1122-
if f == nil {
1123-
return ""
1124-
}
1125-
11261118
f.propertiesMu.RLock()
11271119
defer f.propertiesMu.RUnlock()
11281120

@@ -1131,10 +1123,6 @@ func (f *Frame) LoaderID() string {
11311123

11321124
// Name returns the frame name
11331125
func (f *Frame) Name() string {
1134-
if f == nil {
1135-
return ""
1136-
}
1137-
11381126
f.propertiesMu.RLock()
11391127
defer f.propertiesMu.RUnlock()
11401128

common/request.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,5 @@ func (r *Request) Timing() goja.Value {
264264

265265
// URL returns the request URL
266266
func (r *Request) URL() string {
267-
if r == nil {
268-
return ""
269-
}
270267
return r.url.String()
271268
}

0 commit comments

Comments
 (0)