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.
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user