Skip to content

Commit

Permalink
return nil on attribute_dictionary call from materials or definitionl…
Browse files Browse the repository at this point in the history
…ist entities (#14)

Co-authored-by: Anton Chalakov <[email protected]>
  • Loading branch information
AntonCha and Anton Chalakov authored Nov 7, 2024
1 parent 679ebac commit 79e1fa7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ext/entity.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@ void Sketchup_Entity_attribute_dictionary_Iterator(SUAttributeDictionaryRef dict

static VALUE Sketchup_Entity_attribute_dictionary(int argc, VALUE* argv, VALUE self)
{
if (!rb_obj_is_kind_of(self, rb_path2class(SKETCHUP_MATERIALS)))
return Qnil;
if (!rb_obj_is_kind_of(self, rb_path2class(SKETCHUP_DEFINITIONLIST)))
return Qnil;
SUEntityRef entity = {DATA_PTR(self)};
struct AttributeDictionaryIterationContext attribute_dictionary_struct = {argv[0], SU_INVALID};
FOREACH(SUEntityGetNumAttributeDictionaries, SUEntityGetAttributeDictionaries, SUAttributeDictionaryRef, entity, Sketchup_Entity_attribute_dictionary_Iterator, &attribute_dictionary_struct);
Expand Down

0 comments on commit 79e1fa7

Please sign in to comment.