From 20dce6c6e60352414d00cdbf5f251ee7096fc958 Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Sat, 12 Dec 2020 22:04:40 -0800 Subject: [PATCH] Timeline: Don't assert if peakfile contains no blocks---it's probably just because it was just opened and hasn't been written into yet. --- timeline/src/Engine/Peaks.C | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/timeline/src/Engine/Peaks.C b/timeline/src/Engine/Peaks.C index 0fa4dd9..7b1fc44 100644 --- a/timeline/src/Engine/Peaks.C +++ b/timeline/src/Engine/Peaks.C @@ -188,7 +188,10 @@ public: } if ( ! blocks.size() ) - FATAL( "Peak file contains no blocks!" ); + { + DWARNING( "Peak file contains no blocks, maybe it's still being generated?"); + return; + } blocks.sort(); @@ -258,9 +261,19 @@ public: scan( chunksize ); - assert( _chunksize ); + /* assert( _chunksize ); */ - return true; + if ( blocks.size() ) + { + return true; + } + else + { + DWARNING( "Peak file could not be opened: no blocks" ); + fclose(_fp); + _fp = NULL; + return false; + } } bool