Selaa lähdekoodia

! Don't throw errors if calling the generic list without one defined.

Signed-off-by: Peter Spicer <[email protected]>
Peter Spicer 10 vuotta sitten
vanhempi
commit
60daca13df
1 muutettua tiedostoa jossa 3 lisäystä ja 1 poistoa
  1. 3 1
      Themes/default/GenericList.template.php

+ 3 - 1
Themes/default/GenericList.template.php

@@ -15,7 +15,9 @@ function template_show_list($list_id = null)
 	global $context, $scripturl, $txt, $modSettings;
 
 	// Get a shortcut to the current list.
-	$list_id = $list_id === null ? $context['default_list'] : $list_id;
+	$list_id = $list_id === null ? (!empty($context['default_list']) ? $context['default_list'] : '') : $list_id;
+	if (empty($list_id) || empty($context[$list_id]))
+		return;
 	$cur_list = &$context[$list_id];
 
 	// These are the main tabs that is used all around the template.