From d8afa1b4e470b82a516f05710d36bf0692594e89 Mon Sep 17 00:00:00 2001
From: Paul Holden <paulh@moodle.com>
Date: Thu, 11 Nov 2021 17:25:35 +0000
Subject: [PATCH] MDL-73060 webservice: fix logged config for first enabled
 protocol.

Resolves PHP notice from 1dfa86b4.
---
 lib/classes/plugininfo/webservice.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/classes/plugininfo/webservice.php b/lib/classes/plugininfo/webservice.php
index 4df6637fd9a..f898155cc6c 100644
--- a/lib/classes/plugininfo/webservice.php
+++ b/lib/classes/plugininfo/webservice.php
@@ -78,7 +78,7 @@ class webservice extends base {
 
         if ($haschanged) {
             $new = implode(',', array_flip($plugins));
-            add_to_config_log('webserviceprotocols', $CFG->webserviceprotocols, $new, 'core');
+            add_to_config_log('webserviceprotocols', $CFG->webserviceprotocols ?? '', $new, 'core');
             set_config('webserviceprotocols', $new);
             // Reset caches.
             \core_plugin_manager::reset_caches();