diff --git a/includes/system_branding.inc b/includes/system_branding.inc
index 62e1bdb2e91e7f3b34ca2c64541ceef99bbf53b8..11ab6aa03f8ef51f306352598b8bee9affa6f7f5 100644
--- a/includes/system_branding.inc
+++ b/includes/system_branding.inc
@@ -24,7 +24,13 @@ function civictheme_preprocess_block__system_branding_block(array &$variables):
   $variables['show_site_name'] = !empty($variables['elements']['#configuration']['use_site_name']);
   $variables['show_site_slogan'] = !empty($variables['elements']['#configuration']['use_site_slogan']);
 
-  $is_footer_region = !empty($variables['elements']['#id']) && str_starts_with(Block::load($variables['elements']['#id'])->getRegion(), 'footer');
+  $is_footer_region = false;
+  if (!empty($variables['elements']['#id'])) {
+    $block = Block::load($variables['elements']['#id']);
+    if ($block) {
+      $is_footer_region = str_starts_with($block->getRegion(), 'footer');
+    }
+  }
 
   $theme = $is_footer_region
     ? civictheme_get_theme_config_manager()->load('components.footer.theme', CivicthemeConstants::FOOTER_THEME_DEFAULT)