From 42ef6fb2e53d46361f9a3606125aa4c3a2440ecd Mon Sep 17 00:00:00 2001 From: terrtia Date: Thu, 25 Apr 2024 14:29:30 +0200 Subject: [PATCH] fix: [ocr] fix None copy date --- bin/lib/objects/abstract_daterange_object.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/lib/objects/abstract_daterange_object.py b/bin/lib/objects/abstract_daterange_object.py index b749e40c..68d03703 100755 --- a/bin/lib/objects/abstract_daterange_object.py +++ b/bin/lib/objects/abstract_daterange_object.py @@ -133,7 +133,8 @@ class AbstractDaterangeObject(AbstractObject, ABC): if first_seen and last_seen: for date in Date.get_daterange(first_seen, last_seen): nb = r_object.zscore(f'{obj_type}:date:{date}', self.id) - r_object.zincrby(f'{self.type}:date:{date}', nb, self.id) + if nb: + r_object.zincrby(f'{self.type}:date:{date}', nb, self.id) update_obj_date(first_seen, self.type) update_obj_date(last_seen, self.type) self._add_create()