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); }