Skip to content

Commit

Permalink
Update Model.php
Browse files Browse the repository at this point in the history
Check to see if arg[1] exists to avoid warning
  • Loading branch information
midweste authored Mar 19, 2024
1 parent 09f8933 commit e19dcb5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ private function bootVariableHooks()
$hook = substr($hooks, 0, -1);
if (is_array($this->{$hooks})) {
foreach ((array)$this->{$hooks} as $name => $args) {
if (is_array($args) and !is_numeric($args[1])) {
if (is_array($args) && (!isset($args[1]) || !is_numeric($args[1]))) {
foreach ($args as $method) {
$this->runVariableHooks($hook, $name, $method);
}
Expand Down

0 comments on commit e19dcb5

Please sign in to comment.