Skip to content
This repository was archived by the owner on Dec 5, 2025. It is now read-only.

Commit c58f2fa

Browse files
author
Samuel Hassine
committed
[client] ID of messages can be null
1 parent f27fe25 commit c58f2fa

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

pycti/connector/opencti_connector_helper.py

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -316,16 +316,21 @@ def run(self):
316316
logging.info("Catchup done")
317317
else:
318318
event_id = msg.id
319-
date = datetime.datetime.fromtimestamp(
320-
round(int(event_id.split("-")[0]) / 1000)
321-
)
322-
logging.info(
323-
"Processing message (id: " + event_id + ", date: " + str(date) + ")"
324-
)
319+
if event_id is not None:
320+
date = datetime.datetime.fromtimestamp(
321+
round(int(event_id.split("-")[0]) / 1000)
322+
)
323+
logging.info(
324+
"Processing message (id: "
325+
+ event_id
326+
+ ", date: "
327+
+ str(date)
328+
+ ")"
329+
)
330+
state = self.helper.get_state()
331+
state["connectorLastEventId"] = str(event_id)
332+
self.helper.set_state(state)
325333
self.callback(msg)
326-
state = self.helper.get_state()
327-
state["connectorLastEventId"] = str(msg.id)
328-
self.helper.set_state(state)
329334

330335

331336
class OpenCTIConnectorHelper:

0 commit comments

Comments
 (0)