diff --git a/xmlsitemap_menu/xmlsitemap_menu.module b/xmlsitemap_menu/xmlsitemap_menu.module
index 511b8e5..2362847 100644
--- a/xmlsitemap_menu/xmlsitemap_menu.module
+++ b/xmlsitemap_menu/xmlsitemap_menu.module
@@ -99,6 +99,15 @@ function xmlsitemap_menu_xmlsitemap_index_links($limit) {
  *   An array of menu link IDs.
  */
 function xmlsitemap_menu_xmlsitemap_process_menu_links(array $mlids, array $xmlsitemap = array()) {
+  // Blunt anti-recursion fuse.
+  // See https://www.drupal.org/project/xmlsitemap/issues/1788284 for details.
+  static $recursion = FALSE;
+
+  if ($recursion) {
+    return;
+  }
+  $recursion = TRUE;
+
   // Set the global user variable to the anonymous user.
   xmlsitemap_switch_user(0);
 
