From 0d0b02b915a5a6c406ff6b96d89cf7711b47e704 Mon Sep 17 00:00:00 2001 From: Jordi Sanfeliu Date: Mon, 10 Dec 2012 17:15:08 +0100 Subject: [PATCH] 3.0: fixed to check if string has any value --- 3.0/lib/Monitorix.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/3.0/lib/Monitorix.pm b/3.0/lib/Monitorix.pm index d140f72..0c235eb 100644 --- a/3.0/lib/Monitorix.pm +++ b/3.0/lib/Monitorix.pm @@ -35,9 +35,11 @@ sub logger { sub trim { my $str = shift; - $str =~ s/^\s+//; - $str =~ s/\s+$//; - return $str; + if($str) { + $str =~ s/^\s+//; + $str =~ s/\s+$//; + return $str; + } } sub get_nvidia_data {