Permalink
Browse files

MDL-58220 repository: prevent repo breaking when issuer doesn't exist

  • Loading branch information...
danpoltawski authored and damyon committed Mar 29, 2017
1 parent 9c2baf0 commit 5afb4f0e50a79aa016f745e651a007033c6b391e
Showing with 10 additions and 2 deletions.
  1. +5 −1 repository/googledocs/lib.php
  2. +5 −1 repository/skydrive/lib.php
@@ -67,7 +67,11 @@ class repository_googledocs extends repository {
public function __construct($repositoryid, $context = SYSCONTEXTID, $options = array(), $readonly = 0) {
parent::__construct($repositoryid, $context, $options, $readonly = 0);
$this->issuer = \core\oauth2\api::get_issuer(get_config('googledocs', 'issuerid'));
try {
$this->issuer = \core\oauth2\api::get_issuer(get_config('googledocs', 'issuerid'));
} catch (dml_missing_record_exception $e) {
$this->disabled = true;
}
}
/**
@@ -63,7 +63,11 @@ class repository_skydrive extends repository {
public function __construct($repositoryid, $context = SYSCONTEXTID, $options = array(), $readonly = 0) {
parent::__construct($repositoryid, $context, $options, $readonly = 0);
$this->issuer = \core\oauth2\api::get_issuer(get_config('skydrive', 'issuerid'));
try {
$this->issuer = \core\oauth2\api::get_issuer(get_config('skydrive', 'issuerid'));
} catch (dml_missing_record_exception $e) {
$this->disabled = true;
}
}
/**

0 comments on commit 5afb4f0

Please sign in to comment.