close possible handle leak generating .index.db

This commit is contained in:
Grahame Grieve 2023-09-20 11:10:41 +10:00
parent 8a81237bd0
commit c8c65530f2
1 changed files with 6 additions and 0 deletions

View File

@ -61,6 +61,12 @@ public class NpmPackageIndexBuilder {
psql = conn.prepareStatement("Insert into ResourceList (FileName, ResourceType, Id, Url, Version, Kind, Type, Supplements, Content, ValueSet) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
} catch (Exception e) {
if (conn != null) {
try {
conn.close();
} catch (SQLException e1) {
}
}
conn = null;
}
}