aboutsummaryrefslogtreecommitdiff
path: root/src/cli/stasis_indexer/helpers.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cli/stasis_indexer/helpers.c')
-rw-r--r--src/cli/stasis_indexer/helpers.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/cli/stasis_indexer/helpers.c b/src/cli/stasis_indexer/helpers.c
index 87ab922..cfc1ed6 100644
--- a/src/cli/stasis_indexer/helpers.c
+++ b/src/cli/stasis_indexer/helpers.c
@@ -8,8 +8,10 @@
struct StrList *get_architectures(struct Delivery ctx[], const size_t nelem) {
struct StrList *architectures = strlist_init();
for (size_t i = 0; i < nelem; i++) {
- if (!strstr_array(architectures->data, ctx[i].system.arch)) {
- strlist_append(&architectures, ctx[i].system.arch);
+ if (ctx[i].system.arch) {
+ if (!strstr_array(architectures->data, ctx[i].system.arch)) {
+ strlist_append(&architectures, ctx[i].system.arch);
+ }
}
}
return architectures;
@@ -18,8 +20,10 @@ struct StrList *get_architectures(struct Delivery ctx[], const size_t nelem) {
struct StrList *get_platforms(struct Delivery ctx[], const size_t nelem) {
struct StrList *platforms = strlist_init();
for (size_t i = 0; i < nelem; i++) {
- if (!strstr_array(platforms->data, ctx[i].system.platform[DELIVERY_PLATFORM_RELEASE])) {
- strlist_append(&platforms, ctx[i].system.platform[DELIVERY_PLATFORM_RELEASE]);
+ if (ctx[i].system.platform) {
+ if (!strstr_array(platforms->data, ctx[i].system.platform[DELIVERY_PLATFORM_RELEASE])) {
+ strlist_append(&platforms, ctx[i].system.platform[DELIVERY_PLATFORM_RELEASE]);
+ }
}
}
return platforms;