Jassert errors

Hi everyone

When I scan my plugin on Logic’s plug-in manager I get this JUCE Assertion failure in juce_AudioBlock.h:251 which is :

jassert (channel < numChannels);

I have a loop in process block which ensures that channel is always less than numChannels.

This code:

auto block = dsp::AudioBlock(buffer);

for (int channel = 0; channel < block.getNumbChannels(); ++channel) {

I’m trying to understand why I get this error while my code ensures that channel is always less than numChannels. What am I missing? I’m having a hard time understanding these jassert errors.