diff --git a/src/main/java/io/supertokens/storage/postgresql/BulkImportProxyStorage.java b/src/main/java/io/supertokens/storage/postgresql/BulkImportProxyStorage.java index f077badd..57879344 100644 --- a/src/main/java/io/supertokens/storage/postgresql/BulkImportProxyStorage.java +++ b/src/main/java/io/supertokens/storage/postgresql/BulkImportProxyStorage.java @@ -87,7 +87,9 @@ public void closeConnectionForBulkImportProxyStorage() throws StorageQueryExcept @Override public void commitTransactionForBulkImportProxyStorage() throws StorageQueryException { try { - this.connection.commitForBulkImportProxyStorage(); + if (this.connection != null) { + this.connection.commitForBulkImportProxyStorage(); + } } catch (SQLException e) { throw new StorageQueryException(e); }