From 42eb57e4d698eb54a353d1ea8be1edadef666936 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 3 May 2008 23:06:06 +0000 Subject: [PATCH] Better error management --- htdocs/core/dolgraph.class.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/core/dolgraph.class.php b/htdocs/core/dolgraph.class.php index c9ff63839bd..861a0a3ad45 100644 --- a/htdocs/core/dolgraph.class.php +++ b/htdocs/core/dolgraph.class.php @@ -124,6 +124,12 @@ class DolGraph */ function draw($file) { + if (! is_array($this->data) || sizeof($this->data) < 1) + { + $this->error="Call to draw method was made but SetData was not called or called with an empty dataset for parameters"; + dolibarr_syslog("DolGraph::draw ".$this->error, LOG_ERR); + return -1; + } $call = "draw_".$this->library; $this->$call($file); }