Skip to content

Object attributes can crash Max #204

@janmech

Description

@janmech

I noticed that when creating objects with the min-devkit that has attributes, Max crashes when setting those attributes with a message-box without an argument.

Example for a simple attribute declaration:

attribute<bool> foo {
        this, "foo", false
    };

When sensing the message foo without any argument max crashes with an out of bound exception, before the setter is called.

This does not seem to happen when the argument Type is a std::vector.

A possible workaround is to also create a message "foo" handle the (missing) there, and call the attribute setter from the message:

message<>foo_setter {
        this, "foo",
         MIN_FUNCTION {
            if(args.size() < 1) {
                cwarn << "missing argument for message linewidth." << endl;
            } else {
                this->linewidth.set(args);
            }
            return {};
            
        },
        
    };

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions