diff --git a/index.js b/index.js index 168693c..3a44415 100644 --- a/index.js +++ b/index.js @@ -125,7 +125,7 @@ function fastifyPostgres (fastify, options, next) { } fastify.addHook('onRoute', routeOptions => { - const transact = routeOptions && routeOptions.pg && routeOptions.pg.transact + const transact = routeOptions?.pg?.transact if ( !transact ||