mirror of
https://github.com/getgrav/grav.git
synced 2026-05-06 11:26:25 +02:00
Proper fix: 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);
|
||||
|
||||
try {
|
||||
$result = call_user_func_array(array($this->image, $method), $args);
|
||||
} catch (\BadFunctionCallException $e) {
|
||||
$result = null;
|
||||
}
|
||||
|
||||
// Returns either current object or result of the action.
|
||||
return $result instanceof ImageFile ? $this : $result;
|
||||
|
||||
Reference in New Issue
Block a user