From bc0a26c9c25b134c7c09ace6dc646fd0e6aa3c52 Mon Sep 17 00:00:00 2001
From: "Hahn Axel (hahn)" <axel.hahn@iml.unibe.ch>
Date: Tue, 25 Oct 2022 16:37:35 +0200
Subject: [PATCH] handle empty value in ph.perfadd

---
 inc_pluginfunctions | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/inc_pluginfunctions b/inc_pluginfunctions
index f9f50fc..7471547 100644
--- a/inc_pluginfunctions
+++ b/inc_pluginfunctions
@@ -30,6 +30,7 @@
 # 2020-03-05  v1.2  <axel.hahn@iml.unibe.ch> switch to ph.* helper functions
 # 2020-09-01  v1.3  <axel.hahn@iml.unibe.ch> added ph.hasParamoption
 # 2022-08-31  v1.4  <axel.hahn@iml.unibe.ch> shellfix corrections
+# 2022-10-25  v1.5  <axel.hahn@iml.unibe.ch> handle empty value in ph.perfadd
 # ======================================================================
 
 
@@ -437,9 +438,9 @@ function ph.perfadd(){
   local _min=$5
   local _max=$6
 
-  if [ -z "$_min" ]; then
-    _min=0
-  fi
+  test -z "$_value" && _value=0
+  test -z "$_min"   && _min=0
+  
   echo "${_label}=${_value};${_w};${_c};${_min};${_max}" >>"${ph_perfdatafile}"
 }
 
-- 
GitLab