From ae46e90e0d6b1a1ad82c28d524a39940bd29c211 Mon Sep 17 00:00:00 2001 From: Siddhartha Basu Date: Tue, 23 Apr 2024 10:45:59 -0500 Subject: [PATCH] fix(strainsyn.go): correct nil check to prevent potential null pointer exception The nil check was previously checking the 'Data' field of the 'tac' object. However, if 'tac' itself was null, this would result in a null pointer exception. The nil check has been corrected to check 'tac' instead of 'tac.Data', preventing potential crashes due to null pointer exceptions. --- internal/load/stockcenter/strainsyn.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/load/stockcenter/strainsyn.go b/internal/load/stockcenter/strainsyn.go index 1950d174..ef5e638e 100644 --- a/internal/load/stockcenter/strainsyn.go +++ b/internal/load/stockcenter/strainsyn.go @@ -84,7 +84,7 @@ func removeExistingSynonyms( if err != nil && status.Code(err) != codes.NotFound { return fmt.Errorf("error in listing synonyms for %s %s", entryId, err) } - if tac.Data == nil { + if tac == nil { logger.Debugf("synonym %s is absent, no need to remove it", entryId) return nil }