Skip to content

Commit

Permalink
fix custom names crash
Browse files Browse the repository at this point in the history
  • Loading branch information
benkuper committed Nov 26, 2024
1 parent ee67795 commit c2b99ee
Showing 1 changed file with 29 additions and 10 deletions.
39 changes: 29 additions & 10 deletions Source/Node/Node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -621,23 +621,42 @@ var Node::getJSONData()

bool hasCustomInputNames = false;
bool hasCustomOutputNames = false;
for (int i = 0; i < numAudioInputs->intValue(); i++)

if (numAudioInputs != nullptr)
{
String s = dynamic_cast<Parameter*>(customInputNamesCC->controllables[i])->stringValue();
if (s.isNotEmpty())
for (int i = 0; i < numAudioInputs->intValue(); i++)
{
customInputNamesData.getDynamicObject()->setProperty(String(i), s);
hasCustomInputNames = true;
if (customInputNamesCC->controllables.size() <= i)
{
NLOGWARNING(niceName, "Custom input names CC does not have enough controllables !");
break;
}

String s = dynamic_cast<Parameter*>(customInputNamesCC->controllables[i])->stringValue();
if (s.isNotEmpty())
{
customInputNamesData.getDynamicObject()->setProperty(String(i), s);
hasCustomInputNames = true;
}
}
}

for (int i = 0; i < numAudioOutputs->intValue(); i++)
if (numAudioOutputs != nullptr)
{
String s = dynamic_cast<Parameter*>(customOutputNamesCC->controllables[i])->stringValue();
if (s.isNotEmpty())
for (int i = 0; i < numAudioOutputs->intValue(); i++)
{
customOutputNamesData.getDynamicObject()->setProperty(String(i), s);
hasCustomOutputNames = true;
if (customOutputNamesCC->controllables.size() <= i)
{
NLOGWARNING(niceName, "Custom input names CC does not have enough controllables !");
break;
}

String s = dynamic_cast<Parameter*>(customOutputNamesCC->controllables[i])->stringValue();
if (s.isNotEmpty())
{
customOutputNamesData.getDynamicObject()->setProperty(String(i), s);
hasCustomOutputNames = true;
}
}
}

Expand Down

0 comments on commit c2b99ee

Please sign in to comment.