Skip to content

Commit 2369ba1

Browse files
committed
Ensure environment and environment.id exists
1 parent ed6bc93 commit 2369ba1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/workflows/recipe/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ def unwrap_recipe(header, message):
7373
if header.get("workflows-recipe") in {True, "True", "true", 1}:
7474
otel_logs = None
7575
rw = RecipeWrapper(message=message, transport=transport_layer)
76-
if rw.environment.get("ID"):
76+
77+
if hasattr(rw,"environment") and rw.environment.get("ID"):
7778
# Extract recipe ID from environment and add to current span
7879
span = trace.get_current_span()
7980
recipe_id = rw.environment.get("ID")

0 commit comments

Comments
 (0)