<commit_before><?php
declare(strict_types=1);

namespace zauberfisch\SerializedDataObject;

class SortedDataList extends DataList {
	protected function deserializeItems(array $items) {
		$_items = [];
		foreach ($items as $item) {
			$className = $item[0];
			$id = $item[1];
			$_items[] = $className::get()->byID($id);
		}
		return $_items;
	}
}<commit_msg>FIX: SortedDataList should never contain non-existing objects or null<commit_after><?php
declare(strict_types=1);

namespace zauberfisch\SerializedDataObject;

class SortedDataList extends DataList {
	protected function deserializeItems(array $items) {
		$_items = [];
		foreach ($items as $item) {
			$className = $item[0];
			$id = $item[1];
			$itemObj = $className::get()->byID($id);
			if ($itemObj && $itemObj->exists()) {
				$_items[] = $itemObj;
			}
		}
		return $_items;
	}
}
{'fraction_non_alphanumeric': 0.15857988165680473, 'fraction_numerical': 0.007100591715976331, 'mean_word_length': 4.794520547945205, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, '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': '6400922', 'n_tokens_mistral': 313, 'n_tokens_neox': 284, 'n_words': 63}