Skip to content

Commit

Permalink
handle packageRefs == nil
Browse files Browse the repository at this point in the history
  • Loading branch information
neolynx committed Jun 20, 2024
1 parent 6e5b3fd commit 902fbd5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions deb/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ func (s *Snapshot) String() string {

// NumPackages returns number of packages in snapshot
func (s *Snapshot) NumPackages() int {
if s.packageRefs == nil {
return 0
}

Check warning on line 119 in deb/snapshot.go

View check run for this annotation

Codecov / codecov/patch

deb/snapshot.go#L118-L119

Added lines #L118 - L119 were not covered by tests
return s.packageRefs.Len()
}

Expand Down

0 comments on commit 902fbd5

Please sign in to comment.