From 22e550ab4075d7c3f7dd3860e37c6bd383a74aa9 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Tue, 6 Jan 2015 11:33:53 -0700 Subject: [PATCH] Proper fix: Put in non-exception throwing handler for undefined methods on Medium objects --- system/src/Grav/Common/Page/Medium.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/system/src/Grav/Common/Page/Medium.php b/system/src/Grav/Common/Page/Medium.php index 85082009f..b963b0906 100644 --- a/system/src/Grav/Common/Page/Medium.php +++ b/system/src/Grav/Common/Page/Medium.php @@ -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;