#vulnerable code 
                                public synchronized void deleteRepoByName(String repositoryName) {
        Connection connection;
        PreparedStatement preparedStatement = null;
        ResultSet resultSet = null;

        try {
            connection = this.dbConfig.getConnection();
            preparedStatement = connection.prepareStatement("delete from repo where name=?;");
            preparedStatement.setString(1, repositoryName);
            preparedStatement.execute();
        } catch (SQLException ex) {
            this.logger.severe(String.format("8f05a49c::error in class %s exception %s searchcode was unable to delete repository by name %s, this is unlikely to break anything but there should be other errors in the logs", ex.getClass(), ex.getMessage(), repositoryName));
        } finally {
            this.helpers.closeQuietly(resultSet);
            this.helpers.closeQuietly(preparedStatement);
        }
    } 
                            #location 14 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                                public synchronized void deleteRepoByName(String repositoryName) {
        ConnStmtRs connStmtRs = new ConnStmtRs();

        try {
            connStmtRs.conn = this.dbConfig.getConnection();
            connStmtRs.stmt = connStmtRs.conn.prepareStatement("delete from repo where name=?;");
            connStmtRs.stmt.setString(1, repositoryName);
            connStmtRs.stmt.execute();
        } catch (SQLException ex) {
            this.logger.severe(String.format("8f05a49c::error in class %s exception %s searchcode was unable to delete repository by name %s, this is unlikely to break anything but there should be other errors in the logs", ex.getClass(), ex.getMessage(), repositoryName));
        } finally {
            this.helpers.closeQuietly(connStmtRs, this.dbConfig.closeConnection());
        }
    }