From 29f09227053a0f39b812230adc36871c79f0c9e9 Mon Sep 17 00:00:00 2001 From: Jean Baptiste Favre Date: Tue, 25 Feb 2014 23:31:09 +0100 Subject: [PATCH] Add check after oembed API call. In case of error, returned value is false which generate error messages 'Trying to get property of non-object'. --- classes/File.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/classes/File.php b/classes/File.php index a5914b506e..db80159d3b 100644 --- a/classes/File.php +++ b/classes/File.php @@ -116,7 +116,9 @@ class File extends Managed_DataObject } catch (Exception $e) { return false; } - + if ($oembed_data === false) { + return false; + } $fo = File_oembed::getKV('file_id', $this->id); if ($fo instanceof File_oembed) { -- 2.39.5