Skip to content

Commit eb4a7bd

Browse files
committed
Fix error
1 parent 67383b2 commit eb4a7bd

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

sentry_sdk/integrations/pymongo.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,9 @@ def started(self, event: "CommandStartedEvent") -> None:
185185
data.update(db_data)
186186

187187
try:
188-
lsid_id = lsid["id"]
189-
data["operation_ids"]["session"] = str(lsid_id)
188+
if lsid:
189+
lsid_id = lsid["id"]
190+
data["operation_ids"]["session"] = str(lsid_id)
190191
except KeyError:
191192
pass
192193

0 commit comments

Comments
 (0)