diff --git a/admin/webservice/forms.php b/admin/webservice/forms.php index 4f15173f35c..4f5d837c380 100644 --- a/admin/webservice/forms.php +++ b/admin/webservice/forms.php @@ -196,8 +196,12 @@ class external_service_functions_form extends moodleform { //we add the descriptions to the functions foreach ($functions as $functionid => $functionname) { //retrieve full function information (including the description) - $function = \core_external\external_api::external_function_info($functionname); - if (empty($function->deprecated)) { + try { + $function = \core_external\external_api::external_function_info($functionname); + } catch (Throwable $exception) { + $function = null; + } + if ($function !== null && empty($function->deprecated)) { $functions[$functionid] = $function->name . ':' . $function->description; } else { // Exclude the deprecated ones.