Skip to content

Commit f8ff501

Browse files
committed
- Add null checks for returning bind values
1 parent d155fb8 commit f8ff501

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

plugins/node/opentelemetry-instrumentation-oracledb/src/OracleTelemetryTraceHandler.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ export function getOracleTelemetryTraceHandlerClass(
146146
// db.operation.parameter.name = "someval" // for bind by name
147147
// It is only called if config 'enhancedDatabaseReporting' is true.
148148
private _getValues(values: any) {
149+
if (!values) return undefined;
149150
const convertedValues: Record<string, string> = {};
150151

151152
try {
@@ -183,6 +184,7 @@ export function getOracleTelemetryTraceHandlerClass(
183184
}
184185
} catch (e) {
185186
diag.error('failed to stringify bind values:', values, e);
187+
return undefined;
186188
}
187189
return convertedValues;
188190
}

0 commit comments

Comments
 (0)