Skip to content

Commit 7bb3f6c

Browse files
Fix fatal error on page not found (#6)
1 parent 20262fd commit 7bb3f6c

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

layout_custom_theme.module

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,16 @@ function layout_custom_theme_form_layout_settings_form_alter_submit($form, &$for
105105
function layout_custom_theme_custom_theme() {
106106
// Get the current item.
107107
$item = menu_get_item();
108-
// Get the layout in use by the current item.
109-
$layout = layout_get_layout_by_path(NULL, $item);
110-
// Attempt to retrieve a custom theme settings for this layout.
111-
$theme = config_get('layout_custom_theme.settings', $layout->name);
112-
// If a setting is returned, define this as the custom theme.
113-
if ($theme) {
114-
return $theme;
108+
109+
// Check that an item has been returned.
110+
if ($item) {
111+
// Get the layout in use by the current item.
112+
$layout = layout_get_layout_by_path(NULL, $item);
113+
// Attempt to retrieve a custom theme settings for this layout.
114+
$theme = config_get('layout_custom_theme.settings', $layout->name);
115+
// If a setting is returned, define this as the custom theme.
116+
if ($theme) {
117+
return $theme;
118+
}
115119
}
116120
}

0 commit comments

Comments
 (0)