Skip to content

Commit 0b81fc0

Browse files
authored
Psycopg2: Assure index exists before referencing (#176)
1 parent e30382b commit 0b81fc0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

instana/instrumentation/psycopg2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
def register_type_with_instana(wrapped, instance, args, kwargs):
2121
args_clone = list(copy.copy(args))
2222

23-
if hasattr(args_clone[1], '__wrapped__'):
23+
if (len(args_clone) >= 2) and (args_clone[1], '__wrapped__'):
2424
args_clone[1] = args_clone[1].__wrapped__
2525

2626
return wrapped(*args_clone, **kwargs)

0 commit comments

Comments
 (0)