Skip to content

Commit 2573aae

Browse files
committed
Guard against nulls in transaction name elements
1 parent b4764de commit 2573aae

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/Agent/NewRelic/Agent/Extensions/Providers/Wrapper/Hangfire/HangfirePerformerWrapper.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@ public AfterWrappedMethodDelegate BeforeWrappedMethod(InstrumentedMethodCall ins
4040
var serverId = HangfireHelper.GetServerId(performContext, agent);
4141

4242
// Build transaction name
43-
var taskName = jobClassName + "." + jobMethodName;
43+
var taskName = "unknown";
44+
if (jobClassName is not null && jobMethodName is not null)
45+
{
46+
taskName = jobClassName + "." + jobMethodName;
47+
}
4448

4549
// Create background transaction following Ruby formatting for ActiveJob
4650
transaction = agent.CreateTransaction(

0 commit comments

Comments
 (0)