From 77cd2f6fd4d6a9b0dccf199db4f79345065f16e4 Mon Sep 17 00:00:00 2001 From: Anthony McGreevy <95239463+amcgreevy-r7@users.noreply.github.com> Date: Fri, 19 Jul 2024 07:07:56 +0100 Subject: [PATCH] Added catch for empty flow results (#146) Catch for empty flow results that was causing a null pointer --- services/launcher/storage.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/services/launcher/storage.go b/services/launcher/storage.go index 614a53c..94c712b 100644 --- a/services/launcher/storage.go +++ b/services/launcher/storage.go @@ -2,6 +2,7 @@ package launcher import ( "context" + "errors" "www.velocidex.com/golang/cloudvelo/schema/api" cvelo_schema_api "www.velocidex.com/golang/cloudvelo/schema/api" @@ -148,7 +149,9 @@ func (self *FlowStorageManager) LoadCollectionContext( collection_context = mergeRecords(collection_context, stats_context) } - + if collection_context == nil { + return nil, errors.New("Not found") + } launcher.UpdateFlowStats(collection_context) return collection_context, nil