diff --git a/enrol/category/locallib.php b/enrol/category/locallib.php
index <HASH>..<HASH> 100644
--- a/enrol/category/locallib.php
+++ b/enrol/category/locallib.php
@@ -254,6 +254,7 @@ function enrol_category_sync_full() {
                 $plugin->delete_instance($instance);
             }
         }
+        return;
     }
 
     list($roleids, $params) = $DB->get_in_or_equal(array_keys($roles), SQL_PARAMS_NAMED, 'r000');
MDL-<I> added missing return