fix: skip invalid lines (#160)

This commit is contained in:
Sébastien Morais 2025-08-11 02:11:12 +02:00 committed by GitHub
parent cbdbab28e6
commit 9a146f43d1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -52,6 +52,10 @@ func getNonVirtualPackage(executor exec.Executor, name string) (pkg *AptPackage,
func getPackage(executor exec.Executor, paragraph string) (pkg *AptPackage, err error) {
errMsgs := []string{}
for _, splitLine := range GetSplitLines(paragraph, ":", 2) {
if len(splitLine.Words) < 2 {
logging.Debug("Skipping invalid line: %+v\n", splitLine.Line)
continue
}
switch splitLine.Words[0] {
case "Package":
// Initialize since this will provide the first struct value if present.