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'.

This commit is contained in:
Jean Baptiste Favre 2014-02-25 23:31:09 +01:00
parent 8b04bcb310
commit 29f0922705
1 changed files with 3 additions and 1 deletions

View File

@ -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) {