BUG Report: ValueTree::copyPropertiesAndChildrenFrom with same ValueTree

Hi @juceteam

I just spent the last 30 minutes trying to find a bug where all children from my ValueTree went missing. The cause was that I was call v1.copyPropertiesAndChildrenFrom(v2) while v1 and v2 point to the same underlying resource. Since the implementation clears the children first, to then add every child form the parameter, the children from the parameter are cleared also.
If a check inside the function, if this points to the same resource as the parameter and then do an early return is not reasonable, I’d suggest at least adding an assert.

Thanks for reading!

Thank you for reporting.