Skip to content

Commit 1a0038d

Browse files
committed
handle packageRefs == nil
1 parent 23a9f50 commit 1a0038d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

deb/snapshot.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ func (s *Snapshot) String() string {
114114

115115
// NumPackages returns number of packages in snapshot
116116
func (s *Snapshot) NumPackages() int {
117+
if s.packageRefs == nil {
118+
return 0
119+
}
117120
return s.packageRefs.Len()
118121
}
119122

0 commit comments

Comments
 (0)