lalpulsar_CFSv2 missing error checking for empty grid file
Description of problem
When running CFSv2 on an empty grid file by accident, it doesn't give a reasonable error message, but complains about the SFT being too long for a (random number from non-initialized grid) frequency value.
2024-11-28 08:34:23.5331 (419282) [normal]: Finding all SFTs to load ... done. (found 2 SFTs)
2024-11-28 08:34:24.4851 (419282) [normal]: Setting up template grid ... template grid ready.
2024-11-28 08:34:24.4856 (419282) [normal]: template counting not implemented yet for gridType=6!
XLAL Error - XLALFstatCheckSFTLengthMismatch (ComputeFstat.c:220): Length of input SFTs (1800 s) must be less than 1.53591e-25 s for CW signal with frequency = 3.57815e+59, binary asini = 0, period = 0 to stay below mismatch of 0.05.
XLAL Error - XLALFstatCheckSFTLengthMismatch (ComputeFstat.c:220): Invalid argument
XLAL Error - InitFstat (ComputeFstatistic_v2.c:1404): Excessive mismatch would be incurred due to SFTs being too long for the current search setup. Please double-check your parameter ranges or provide shorter input SFTs. If you really know what you're doing, you could also consider using the --allowedMismatchFromSFTLength override.
XLAL Error - InitFstat (ComputeFstatistic_v2.c:1404): Internal function call failed: Invalid argument
XLAL Error - main (ComputeFstatistic_v2.c:396): Check failed: InitFstat( &GV, &uvar ) == XLAL_SUCCESS
XLAL Error - main (ComputeFstatistic_v2.c:396): Internal function call failed: Invalid argument
Expected behavior
It should say that the grid file is empty.
Steps to reproduce
lalpulsar_Makefakedata_v5 --outSFTdir=. --IFOs=H1 --startTime=1416846768 --duration=3600 --Tsft=1800 --fmin=50 --Band=0.1
touch empty.grid
lalpulsar_ComputeFstatistic_v2 --gridType=6 --DataFiles=H-2_H1_1800SFT_mfdv5-1416846768-3600.sft --refTime=1398372936 --gridFile=empty.grid
Context/environment
current igwn environment with lalpulsar 7.0.1
Suggested solutions
Extra error check should be implemented.