<commit_before>module.exports = function cleanupPassportSession(req, res, next) {
    var _end = res.end;
    var ended = false;
    res.end = function end(chunk, encoding) {
		if (ended) {
			return;
		}
		ended = true;

		if (req.session && Object.keys(req.session.passport).length === 0) {
			delete req.session.passport;
		}
		_end.call(res, chunk, encoding);
	};
	next();
};<commit_msg>Added undefined check for session.passport<commit_after>module.exports = function cleanupPassportSession(req, res, next) {
    var _end = res.end;
    var ended = false;
    res.end = function end(chunk, encoding) {
		if (ended) {
			return;
		}
		ended = true;

		if (req.session && req.session.passport && Object.keys(req.session.passport).length === 0) {
			delete req.session.passport;
		}
		_end.call(res, chunk, encoding);
	};
	next();
};
{'fraction_non_alphanumeric': 0.1497005988023952, 'fraction_numerical': 0.0023952095808383233, 'mean_word_length': 3.4946236559139785, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '578256', 'n_tokens_mistral': 309, 'n_tokens_neox': 284, 'n_words': 65}