Skip to content

Commit

Permalink
Merge pull request #88 from craftcms/bugfix/fix-87
Browse files Browse the repository at this point in the history
Fix #87 - Correct return type
  • Loading branch information
angrybrad authored May 23, 2024
2 parents 8cf5cd7 + f9c3ba8 commit f49373f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Release Notes for Guest Entries

## Unreleased

### Fixed
- Fixed a PHP error that could occur on validation failure. ([#87](https://github.com/craftcms/guest-entries/issues/87))

## 4.0.0 - 2024-03-19

- Added Craft 5 compatibility.
Expand Down
4 changes: 2 additions & 2 deletions src/controllers/SaveController.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,9 @@ private function _returnSuccess(Entry $entry, $isSpam = false): Response
*
* @param Settings $settings
* @param Entry $entry
* @return Response
* @return Response|null
*/
private function _returnError(Settings $settings, Entry $entry): Response
private function _returnError(Settings $settings, Entry $entry): ?Response
{
if ($this->hasEventHandlers(self::EVENT_AFTER_ERROR)) {
$this->trigger(self::EVENT_AFTER_ERROR, new SaveEvent([
Expand Down

0 comments on commit f49373f

Please sign in to comment.