From aa89bf2e6c0ca31101bc2864043cb722a610b8b4 Mon Sep 17 00:00:00 2001 From: Damyon Wiese Date: Fri, 31 Mar 2017 12:50:11 +0800 Subject: [PATCH] MDL-58220 repo: Dont expect file info for any file Some plugins do not implement the file info callback so expect and handle null in this case. --- repository/googledocs/lib.php | 2 +- repository/onedrive/lib.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/repository/googledocs/lib.php b/repository/googledocs/lib.php index 3520254d96b..1ce0e1bdc15 100644 --- a/repository/googledocs/lib.php +++ b/repository/googledocs/lib.php @@ -588,7 +588,7 @@ class repository_googledocs extends repository { $storedfile->get_filepath(), $storedfile->get_filename()); - if (empty($options['offline']) && $info->is_writable()) { + if (empty($options['offline']) && !empty($info) && $info->is_writable()) { // Add the current user as an OAuth writer. $systemauth = \core\oauth2\api::get_system_oauth_client($this->issuer); diff --git a/repository/onedrive/lib.php b/repository/onedrive/lib.php index 5e79d9bca96..73118a34230 100644 --- a/repository/onedrive/lib.php +++ b/repository/onedrive/lib.php @@ -537,7 +537,7 @@ class repository_onedrive extends repository { $storedfile->get_filepath(), $storedfile->get_filename()); - if (empty($options['offline']) && $info->is_writable()) { + if (empty($options['offline']) && !empty($info) && $info->is_writable()) { // Add the current user as an OAuth writer. $systemauth = \core\oauth2\api::get_system_oauth_client($this->issuer);