Skip to content

Commit 23e3de2

Browse files
authored
Fix possible ArgumentNullException when provider is unable to open a connection (#2794)
1 parent 4c4aa07 commit 23e3de2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/NHibernate/Tool/hbm2ddl/SchemaExport.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,11 @@ private void InitConnectionAndExecute(Action<string> scriptAction, bool execute,
468468
{
469469
if (connectionProvider != null)
470470
{
471-
connectionProvider.CloseConnection(connection);
471+
if (connection != null)
472+
{
473+
connectionProvider.CloseConnection(connection);
474+
}
475+
472476
connectionProvider.Dispose();
473477
}
474478
}

0 commit comments

Comments
 (0)