Stuck updating ValueTree parameters

First time using ValueTrees so I may be misunderstanding the purpose.

I have a function that gets called when a slider value is changed. This function supposedly updates parameters in a ValueTree - which it does for a bit. But frequently this causes assertions " JUCE Assertion failure in juce_ArrayBase.h:142". Am I completely on the wrong track, this code is:

void setParameter(float value)
{
    static Identifier parameterIdentifier ("Parameter");
    parameters.setProperty(parameterIdentifier, value, nullptr);
}

Thanks

Maybe a thread safety issue? Is some other code running in another thread trying to read or write into the tree at the same time?

We need more context to help diagnose the problem. The first helpful bit is an entire stack trace that leads up to the assertion. Bottom line though, what you’ve shown looks correct, which would indicate you are doing something wrong elsewhere.