LIMO-EEG-Toolbox / limo_tools

Hierarchical Linear Modelling for MEEG data
https://limo-eeg-toolbox.github.io/limo_meeg/
Other
58 stars 27 forks source link

Fix faulty input validation #70

Closed luka-ve closed 3 years ago

luka-ve commented 3 years ago

Same as original pull request, changed to HotFixes branch.

I have encountered this issue when plugging in a 3-dimensional bootM matrix.

Expected behavior: Error should be thrown if ndim is neither 3 nor 4. Actual behavior: Error is thrown is ndim is not 3 and 4 at the same time.

I think the logic of the original issue goes as follow:

Given ndim = 3 if ndim != 3 (which evaluates to false, since ndim is 3), check whether ndim != 4. The second comparison evaluates to true, since dim = 3. The OR operator evaluates to true then and the error is thrown.