# Assert error when debugging MidiLoggerPluginDemo

**URL:** <https://forum.juce.com/t/assert-error-when-debugging-midiloggerplugindemo/49544>\
**Category:** General JUCE discussion\
**Created:** [January 6, 2022, 12:27pm UTC](https://forum.juce.com/t/assert-error-when-debugging-midiloggerplugindemo/49544 "2022-01-06T12:27:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mutenfuzz](https://avatars.discourse-cdn.com/v4/letter/m/90db22/32.png) [@mutenfuzz](https://forum.juce.com/u/mutenfuzz)\
**Post date:** [January 6, 2022, 12:27pm UTC](https://forum.juce.com/t/assert-error-when-debugging-midiloggerplugindemo/49544/1 "2022-01-06T12:27:25Z")

</div>

Hi, new member here. I’m getting my feet wet with JUCE by studying some of the code examples provided. I’m stuck with this assertion error while debugging the MidiLoggerPluginDemo with the AudioPluginHost:

JUCE Assertion failure in juce\_AudioSampleBuffer.h:520

which refers to this piece of code:

```
void setDataToReferTo (Type** dataToReferTo,
                       int newNumChannels,
                       int newStartSample,
                       int newNumSamples)
{
    jassert (dataToReferTo != nullptr); <---- failed here

```

I haven’t changed the example code in any way. The plugin works fine unless it’s being debugged.

I’m running JUCE v6.1.4 and Xcode 12.4 on macOS Catalina.

Thanks

---

<div class="post-metadata">

**Author:** ![reuk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/reuk/32/21494_2.png) [@reuk](https://forum.juce.com/u/reuk)\
**Post date:** [January 6, 2022, 5:57pm UTC](https://forum.juce.com/t/assert-error-when-debugging-midiloggerplugindemo/49544/2 "2022-01-06T17:57:36Z")

</div>

Thanks for reporting. Please can you let us know which plugin format you’re using to test the MIDILogger demo (e.g. VST2, VST3, AU)?

Edit: never mind, I can reproduce the issue in the AU plugin. I’ll get that fixed.

Thanks for reporting the issue!

---

<div class="post-metadata">

**Author:** ![mutenfuzz](https://avatars.discourse-cdn.com/v4/letter/m/90db22/32.png) [@mutenfuzz](https://forum.juce.com/u/mutenfuzz)\
**Post date:** [January 6, 2022, 7:30pm UTC](https://forum.juce.com/t/assert-error-when-debugging-midiloggerplugindemo/49544/3 "2022-01-06T19:30:10Z")

</div>

Thank you!

---

<div class="post-metadata">

**Author:** ![reuk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/reuk/32/21494_2.png) [@reuk](https://forum.juce.com/u/reuk)\
**Post date:** [January 18, 2022, 4:06pm UTC](https://forum.juce.com/t/assert-error-when-debugging-midiloggerplugindemo/49544/4 "2022-01-18T16:06:06Z")

</div>

Thanks again for reporting this issue. It should be resolved by this patch:

> <https://github.com/juce-framework/JUCE/commit/fc378aaf9ac9d9168172114e4fad39cf1d485fcc>
