Skip to content

Commit

Permalink
Fix error when element ID is null
Browse files Browse the repository at this point in the history
  • Loading branch information
bencroker committed Dec 13, 2023
1 parent 38ac255 commit cf4b300
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Release Notes for Blitz

## 4.9.4 - Unreleased

### Fixed

- Fixed a bug that could cause an error when an element’s ID is unset ([#594](https://github.com/putyourlightson/craft-blitz/issues/594)).

## 4.9.3 - 2023-11-28

### Changed
Expand All @@ -11,7 +17,7 @@
### Changed

- Integrity constraint violation exceptions are now caught when batch inserting rows into the database ([#588](https://github.com/putyourlightson/craft-blitz/issues/588)).
- Reverted sending site URIs to the refresh cache event ([#590](https://github.com/putyourlightson/craft-blitz/issues/590)).
- Reverted sending site URIs to the refresh cache event ([#590](https://github.com/putyourlightson/craft-blitz/issues/590)).

### Fixed

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "putyourlightson/craft-blitz",
"description": "Intelligent static page caching for creating lightning-fast sites.",
"version": "4.9.3",
"version": "4.9.4",
"type": "craft-plugin",
"homepage": "https://putyourlightson.com/plugins/blitz",
"license": "proprietary",
Expand Down
4 changes: 4 additions & 0 deletions src/models/GenerateDataModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ public function addElementIds(array $elementIds): void

public function addElement(ElementInterface $element): void
{
if ($element->id === null) {
return;
}

$this->addElementId($element->id);
}

Expand Down

0 comments on commit cf4b300

Please sign in to comment.