GetSpectrumData error

This feels like I’m missing something basic, but I’m a bit stuck.

I’m just trying to do a vanilla AudioSource.GetSpectrumData() call but I’m getting an error in the console that looks deep:

/Users/builduser/buildslave/unity/build/Runtime/Audio/AudioSource.cpp(1621) : Error executing m_dryGroup->getSpectrum (samples, numSamples, channelOffset, windowType) (An invalid parameter was passed to this function. )
UnityEngine.AudioSource:GetSpectrumData(Single[], Int32, FFTWindow)
AudioMediator:Update() (at Assets/Scripts/AudioMediator.cs:24)

my code looks like this:

public AudioSource MainAudioSource;

void Update () {
		float[] b = new float[32];
		MainAudioSource.GetSpectrumData (b, 0, FFTWindow.BlackmanHarris);
}

Here is a sample project

I found this post looking for an answer, but at the end I found an answer myself.
Apparently 32 is not enough for the GetSpectrumData function, the minimum length for the float array is 64.

Replacing AudioSource with AudioListener seems to stop that error. I’m currently getting a bunch of 0’s though so not sure.

I downgraded to 5.1.3 and it works as expected. I think this bug was introduced in 5.2

how to catch this exception in code ??
i cant catch it !!!