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 d284a9c
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 repo.packageRefs == nil {

Check failure on line 117 in deb/snapshot.go

View workflow job for this annotation

GitHub Actions / test

undefined: repo

Check failure on line 117 in deb/snapshot.go

View workflow job for this annotation

GitHub Actions / lint

undefined: repo (typecheck)

Check failure on line 117 in deb/snapshot.go

View workflow job for this annotation

GitHub Actions / lint

undefined: repo) (typecheck)

Check failure on line 117 in deb/snapshot.go

View workflow job for this annotation

GitHub Actions / lint

undefined: repo) (typecheck)

Check failure on line 117 in deb/snapshot.go

View workflow job for this annotation

GitHub Actions / lint

undefined: repo) (typecheck)
return 0
}
return s.packageRefs.Len()
}

Expand Down

0 comments on commit d284a9c

Please sign in to comment.