We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 41abbe2 commit 8064d95Copy full SHA for 8064d95
src/Illuminate/Database/Eloquent/Model.php
@@ -2447,11 +2447,11 @@ public function offsetExists($offset): bool
2447
2448
static::$modelsShouldPreventAccessingMissingAttributes = false;
2449
2450
- $result = ! is_null($this->getAttribute($offset));
2451
-
2452
- static::$modelsShouldPreventAccessingMissingAttributes = $shouldPrevent;
2453
2454
- return $result;
+ try {
+ return ! is_null($this->getAttribute($offset));
+ } finally {
+ static::$modelsShouldPreventAccessingMissingAttributes = $shouldPrevent;
+ }
2455
}
2456
2457
/**
0 commit comments