Skip to content

Commit 31ffc40

Browse files
committed
fix: Call to a member function getErrors() on null
Since CI 4.5.0, $this->validation may be null.
1 parent af7ddd6 commit 31ffc40

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Models/CheckQueryReturnTrait.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ protected function checkQueryReturn($return): void
4141

4242
protected function checkValidationError(): void
4343
{
44+
$this->validation ??= service('validation');
45+
4446
$validationErrors = $this->validation->getErrors();
4547

4648
if ($validationErrors !== []) {

0 commit comments

Comments
 (0)