Skip to content

Commit b2ceacc

Browse files
Merge pull request #405 from ecordell/fix-prop-listbundle
Fix listbundles property bug
2 parents fcd8203 + ba2ae9d commit b2ceacc

File tree

1 file changed

+18
-19
lines changed

1 file changed

+18
-19
lines changed

pkg/sqlite/query.go

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -943,30 +943,29 @@ func (s *SQLQuerier) ListBundles(ctx context.Context) (bundles []*api.Bundle, er
943943
bundleItem, ok := bundlesMap[bundleKey]
944944
if ok {
945945
// Create new dependency object
946-
dep := &api.Dependency{}
947-
if !depType.Valid || !depValue.Valid {
948-
continue
946+
if depType.Valid && depValue.Valid {
947+
dep := &api.Dependency{}
948+
dep.Type = depType.String
949+
dep.Value = depValue.String
950+
951+
// Add new dependency to the existing list
952+
existingDeps := bundleItem.Dependencies
953+
existingDeps = append(existingDeps, dep)
954+
bundleItem.Dependencies = existingDeps
949955
}
950-
dep.Type = depType.String
951-
dep.Value = depValue.String
952956

953-
// Add new dependency to the existing list
954-
existingDeps := bundleItem.Dependencies
955-
existingDeps = append(existingDeps, dep)
956-
bundleItem.Dependencies = existingDeps
957957

958958
// Create new property object
959-
prop := &api.Property{}
960-
if !propType.Valid || !propValue.Valid {
961-
continue
959+
if propType.Valid && propValue.Valid {
960+
prop := &api.Property{}
961+
prop.Type = propType.String
962+
prop.Value = propValue.String
963+
964+
// Add new property to the existing list
965+
existingProps := bundleItem.Properties
966+
existingProps = append(existingProps, prop)
967+
bundleItem.Properties = existingProps
962968
}
963-
prop.Type = propType.String
964-
prop.Value = propValue.String
965-
966-
// Add new property to the existing list
967-
existingProps := bundleItem.Properties
968-
existingProps = append(existingProps, prop)
969-
bundleItem.Properties = existingProps
970969
} else {
971970
// Create new bundle
972971
out := &api.Bundle{}

0 commit comments

Comments
 (0)