Skip to content

Commit

Permalink
修复监听器为空报错
Browse files Browse the repository at this point in the history
  • Loading branch information
Hanson committed Jun 16, 2017
1 parent f2cfd6a commit 851d7b3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Observers/Observer.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ public function trigger()
{
$args = func_get_args();

call_user_func_array($this->getCallback(), $args);
if (!empty($this->getCallback())) {
call_user_func_array($this->getCallback(), $args);
}
}

protected function setCallback($callback)
Expand Down

0 comments on commit 851d7b3

Please sign in to comment.