Skip to content

Commit

Permalink
FIX: SortedDataList should never contain non-existing objects or null
Browse files Browse the repository at this point in the history
  • Loading branch information
Zauberfisch committed Oct 30, 2018
1 parent 65a7c0b commit 685f324
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/SortedDataList.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ protected function deserializeItems(array $items) {
foreach ($items as $item) {
$className = $item[0];
$id = $item[1];
$_items[] = $className::get()->byID($id);
$itemObj = $className::get()->byID($id);
if ($itemObj && $itemObj->exists()) {
$_items[] = $itemObj;
}
}
return $_items;
}
Expand Down

0 comments on commit 685f324

Please sign in to comment.