Error using Uniform Epoch time

Hi again!
I computed psd sources from a resting EEG file as I used to do it:

Default anatomy
Import the EEG file
set the electrode position
clean the eeg
split the file in epochs
stardardize --> uniform epoch time
No-noise covariance
compute head model (openMeeg)
Sources 2018 (sLoreta)
PSD in 4 bands

everything seems to work, but when I try to display the result I got this message:

Index exceeds matrix dimensions.

Error in bst_memory>GetTimefreqValues (line 2424)
Values = GlobalData.DataSet(iDS).Timefreq(iTimefreq).TF(iRow, iTime, iFreqs);

Error in bst_memory>GetTimefreqMaximum (line 2584)
values = GetTimefreqValues(iDS, iTimefreq, [], [], [], Function);

Error in bst_memory (line 72)
eval(macro_method);

Error in panel_surface>UpdateSurfaceData (line 1698)
TessInfo(iTess).DataMinMax = bst_memory('GetTimefreqMaximum', iDS, iTimefreq, TfInfo.Function);

Error in panel_surface>SetSurfaceData (line 1515)
[isOk, TessInfo] = UpdateSurfaceData(hFig, iTess);

Error in panel_surface (line 40)
eval(macro_method);

Error in view_surface_data (line 298)
isOk = panel_surface('SetSurfaceData', hFig, iTess, OverlayType, OverlayFile, isStat);

Error in tree_callbacks>@(h,ev)view_surface_data([],filenameRelative) (line 2216)
gui_component('MenuItem', jPopup, [], 'Display on cortex', IconLoader.ICON_CORTEX, [],
@(h,ev)view_surface_data([], filenameRelative));

This also happens with 2D disc maps,

everytime I try to compute Welch psd I got messages like these:

BST> process_timefreq: Using 1 windows of 500 samples each
BST> Skipping window #1 because it contains a bad segment.
BST> Skipping window #1 because it contains a bad segment.
BST> Skipping window #1 because it contains a bad segment.
BST> Skipping window #1 because it contains a bad segment.
BST> Skipping window #1 because it contains a bad segment.
BST> process_timefreq: Using 0 windows of 500 samples each
Elapsed time is 0.000708 seconds.

Thanks in advance!

BST> Skipping window #1 because it contains a bad segment.

Remove the BAD events from your files.

I computed psd sources from a resting EEG file as I used to do it:

See our recommended pipeline for computing source-level PSD from resting state recordings:
https://neuroimage.usc.edu/brainstorm/Tutorials/RestingOmega

The point is: the EEG had no bad segments,
to make sure about this I even made right click and select "accept trials"

The trials are not marked as bad trials, but they still include events including the tag "BAD", and are therefore excluded from the PSD computation.

I modified the function executed when clicking on "Accept trial" to remove all the bad events:
https://github.com/brainstorm-tools/brainstorm3/commit/4756493756a7119b0fa02329d1f90a69a88f9643

You can either download the update and do again "Accept trials", or open the trials and delete the BAD events.

I modified this behavior, after a remark in this thread:

@tourette95
Can you please check that the proposed modification works for you?
Thanks

ok , but I think It is better now