From 1a1ef64733a0d440def0b8cdc52507f493b009ee Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Fri, 22 Nov 2024 11:58:51 +0100 Subject: [PATCH] the r2lab node has no interface - the node page was broken in that case --- planetlab/includes/plc_functions.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/planetlab/includes/plc_functions.php b/planetlab/includes/plc_functions.php index 97b0bbb..59a5ac6 100644 --- a/planetlab/includes/plc_functions.php +++ b/planetlab/includes/plc_functions.php @@ -589,6 +589,7 @@ function get_arg ($name,$default=NULL,$method='get') { //////////////////// number of ... function count_english ($objs,$name) { + if (is_null($objs)) return 'No ' . $name; $count=count($objs); if ($count == 0) return 'No ' . $name; else if ($count == 1) return 'One ' . $name; @@ -596,7 +597,7 @@ function count_english ($objs,$name) { } function count_english_warning ($objs, $name) { $x=count_english ($objs,$name); - if (count ($objs) == 0) $x=plc_warning_html($x . ' !!'); + if (is_null($objs) || (count ($objs) == 0)) $x=plc_warning_html($x . ' !!'); return $x; } -- 2.47.0