Skip to content

Commit

Permalink
Merge pull request #581 from projectdiscovery/maint-nil-pointer
Browse files Browse the repository at this point in the history
Fixing nil pointers
  • Loading branch information
Mzack9999 authored Dec 3, 2024
2 parents 2a61a82 + d57d0b0 commit 571a7b0
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions errkit/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,15 +327,17 @@ func parseError(to *ErrorX, err error) {
switch v := err.(type) {
case *ErrorX:
to.append(v.errs...)
if to.record == nil {
to.record = v.record
} else {
v.record.Attrs(func(a slog.Attr) bool {
to.record.Add(a)
return true
})
if v.record != nil {
if to.record == nil {
to.record = v.record
} else {
v.record.Attrs(func(a slog.Attr) bool {
to.record.Add(a)
return true
})
}
}
if to.source == nil {
if to.source == nil && v.source != nil {
to.source = v.source
}
to.kind = CombineErrKinds(to.kind, v.kind)
Expand Down

0 comments on commit 571a7b0

Please sign in to comment.