forked from external/yambar
particle/ramp: handle tag_for_name() failing
This commit is contained in:
parent
05aa44f1ab
commit
31c015c680
1 changed files with 3 additions and 4 deletions
|
@ -95,13 +95,12 @@ 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);
|
||||
|
||||
assert(p->count > 0);
|
||||
|
||||
long value = tag->as_int(tag);
|
||||
long min = tag->min(tag);
|
||||
long max = tag->max(tag);
|
||||
long value = tag != NULL ? tag->as_int(tag) : 0;
|
||||
long min = tag != NULL ? tag->min(tag) : 0;
|
||||
long max = tag != NULL ? tag->max(tag) : 0;
|
||||
|
||||
assert(value >= min && value <= max);
|
||||
assert(max >= min);
|
||||
|
|
Loading…
Add table
Reference in a new issue