Put in non-exception throwing handler for undefined methods on Medium objects

This commit is contained in:
Andy Miller
2015-01-04 15:08:01 -07:00
parent e8b7b40535
commit 00971dee24

View File

@@ -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;