mirror of
https://codeberg.org/dnkl/yambar.git
synced 2025-04-22 12:25:38 +02:00
particle/map: return NULL if we neither find a matching tag, nor have a default tag
This commit is contained in:
parent
4d05947985
commit
1e5a1d0341
1 changed files with 6 additions and 4 deletions
|
@ -87,11 +87,13 @@ instantiate(const struct particle *particle, const struct tag_set *tags)
|
|||
{
|
||||
const struct private *p = particle->private;
|
||||
const struct tag *tag = tag_for_name(tags, p->tag);
|
||||
assert(tag != NULL || p->default_particle != NULL);
|
||||
|
||||
if (tag == NULL)
|
||||
if (tag == NULL) {
|
||||
if (p->default_particle != NULL)
|
||||
return p->default_particle->instantiate(p->default_particle, tags);
|
||||
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const char *tag_value = tag->as_string(tag);
|
||||
struct particle *pp = NULL;
|
||||
|
|
Loading…
Add table
Reference in a new issue