mirror of
https://github.com/getgrav/grav.git
synced 2026-05-06 11:37:12 +02:00
Put in non-exception throwing handler for undefined methods on Medium objects
This commit is contained in:
@@ -313,7 +313,12 @@ class Medium extends Data
|
||||
if (!$this->image) {
|
||||
$this->image();
|
||||
}
|
||||
$result = call_user_func_array(array($this->image, $method), $args);
|
||||
|
||||
if (method_exists($this->image, $method)) {
|
||||
$result = call_user_func_array(array($this->image, $method), $args);
|
||||
} else {
|
||||
$result = null;
|
||||
}
|
||||
|
||||
// Returns either current object or result of the action.
|
||||
return $result instanceof ImageFile ? $this : $result;
|
||||
|
||||
Reference in New Issue
Block a user