From f6eb4c02d94cd601cd895bb90744571daa8acc88 Mon Sep 17 00:00:00 2001 From: Mohamed El-Sawy Date: Tue, 3 Sep 2024 19:40:43 +0300 Subject: [PATCH] CV2-5193: fix sentry issue (#2018) --- app/models/annotations/annotation.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/models/annotations/annotation.rb b/app/models/annotations/annotation.rb index 58bbe9cb89..e8274d62e5 100644 --- a/app/models/annotations/annotation.rb +++ b/app/models/annotations/annotation.rb @@ -17,9 +17,11 @@ def destroy dec = self.disable_es_callbacks skip_ability = self.skip_check_ability a = self.load - a.disable_es_callbacks = dec - a.skip_check_ability = skip_ability - a.destroy + unless a.nil? + a.disable_es_callbacks = dec + a.skip_check_ability = skip_ability + a.destroy + end end private