Skip to content

Commit 67383b2

Browse files
committed
Address bugbot comment
1 parent b8ddc07 commit 67383b2

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
@@ -131,6 +131,7 @@ def started(self, event: "CommandStartedEvent") -> None:
131131

132132
db_data = _get_db_data(event)
133133

134+
lsid = command.pop("lsid", None)
134135
if not should_send_default_pii():
135136
command = _strip_pii(command)
136137

@@ -184,8 +185,8 @@ def started(self, event: "CommandStartedEvent") -> None:
184185
data.update(db_data)
185186

186187
try:
187-
lsid = command.pop("lsid")["id"]
188-
data["operation_ids"]["session"] = str(lsid)
188+
lsid_id = lsid["id"]
189+
data["operation_ids"]["session"] = str(lsid_id)
189190
except KeyError:
190191
pass
191192

0 commit comments

Comments
 (0)