Skip to content

Commit fc6d246

Browse files
committed
Add null check for event and channel info in addEvent method
1 parent 3e4f98c commit fc6d246

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

Source/Processors/GenericProcessor/GenericProcessor.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1402,6 +1402,12 @@ int GenericProcessor::checkForEvents (bool checkForSpikes)
14021402

14031403
void GenericProcessor::addEvent (const Event* event, int sampleNum)
14041404
{
1405+
if (event == nullptr || event->getChannelInfo() == nullptr)
1406+
{
1407+
jassertfalse; // this should never happen
1408+
return;
1409+
}
1410+
14051411
size_t size = event->getChannelInfo()->getDataSize() + event->getChannelInfo()->getTotalEventMetadataSize() + EVENT_BASE_SIZE;
14061412

14071413
HeapBlock<char> buffer (size);

0 commit comments

Comments
 (0)