getObject returns nullptr

Why is getObject() returning nullptr? tracks is a named set in javascript and I need to know the name/key of the indexes and then get the javascript object at each index.

    // good
	auto& properties = d->getProperties();
    // good
    if (! properties.contains("tracks"))
    	return Result::fail("project does not contain property 'tracks'");
    // getObject() returns nullptr
    auto t = dynamic_cast<DynamicObject *>(properties.getVarPointer("tracks")->getObject());

    if (t == nullptr)
    	return Result::fail("tracks property is of the wrong type");

Well, without the JS code it’s difficult to guess… Is your expected javascript object actually an object?

Aside from that, is there a particular reason you aren’t calling var::getDynamicObject() instead of doing that work yourself?

tracks is a key/object thing. So we are getting the reaper object, then getting its properties, then specifically getting the tracks property and trying to get the name of each index and the contents of each index.

reaper.tracks["mytrac"] = { name: "myitem", position:0, length:1 };

My issue is resolved. I decided to go for another design and the problem took care of itself. I don’t care to research into this further. Most likely the problem was that there was a difference in the underlying class/object that I did not realize.