Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
return NULL;
}
- for (struct pakfire_scriptlet** scriptlet = archive->scriptlets; *scriptlet; scriptlet++) {
- const char* t = pakfire_scriptlet_get_type(*scriptlet);
+ if (archive->scriptlets) {
+ for (struct pakfire_scriptlet** scriptlet = archive->scriptlets; *scriptlet; scriptlet++) {
+ const char* t = pakfire_scriptlet_get_type(*scriptlet);
- if (strcmp(t, type) == 0)
- return pakfire_scriptlet_ref(*scriptlet);
+ if (strcmp(t, type) == 0)
+ return pakfire_scriptlet_ref(*scriptlet);
+ }
}
return NULL;