diff --git a/src/InputOutput/IHMImpl/Params/PlotImpl/IHMInputOutputParamsPlotClass.php b/src/InputOutput/IHMImpl/Params/PlotImpl/IHMInputOutputParamsPlotClass.php
index 9288181..9f133fd 100644
--- a/src/InputOutput/IHMImpl/Params/PlotImpl/IHMInputOutputParamsPlotClass.php
+++ b/src/InputOutput/IHMImpl/Params/PlotImpl/IHMInputOutputParamsPlotClass.php
@@ -713,14 +713,18 @@ class IHMInputOutputParamsPlotClass extends IHMInputOutputParamsAbstractClass
 		$histogram2DNodes = array();
 		if (count($indexes) == 0) {
 			$histogram2DNode = $paramNode->addHistogram2DSerie($paramData->{'param-drawing-object'}->{'serie-yaxis'}, -1, $xId);
-			$histogram2DNode->setId($paramData->{'id'});
-			$histogram2DNodes[] = $histogram2DNode;
+			if (isset($histogram2DNode)) {
+				$histogram2DNode->setId($paramData->{'id'});
+				$histogram2DNodes[] = $histogram2DNode;
+			}
 		}
 		foreach ($indexes as $index) {
 			$histogram2DNode = $paramNode->addHistogram2DSerie($paramData->{'param-drawing-object'}->{'serie-yaxis'}, $index, $xId);
-			if (count($indexes) == 1)
-				$histogram2DNode->setId($paramData->{'id'});
-			$histogram2DNodes[] = $histogram2DNode;
+			if (isset($histogram2DNode)) {
+				if (count($indexes) == 1)
+					$histogram2DNode->setId($paramData->{'id'});
+				$histogram2DNodes[] = $histogram2DNode;
+			}
 		}
 
 		// ranges 
diff --git a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotParamsNodeClass.php b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotParamsNodeClass.php
index a1b7b0e..2e24b69 100644
--- a/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotParamsNodeClass.php
+++ b/src/Request/ParamsRequestImpl/Nodes/Requests/RequestOutputPlotParamsNodeClass.php
@@ -102,11 +102,12 @@ class RequestOutputPlotParamNodeClass extends NodeClass
 
 	public function addHistogram2DSerie($yAxis, $index, $xId = -1)
 	{
-		if ($xId != -1) {
-			$histogram2dNode = new RequestOutputPlotHistogram2DSerieNodeClass(REQUESTOUTPUTPLOTHISTOGRAM2DSERIE_NAME);
-			$histogram2dNode->setXId($xId);
-			$histogram2dNode->setXAxisId(REQUESTOUTPUTPLOTELEMENTXY_XAXISID);
-		} 
+		if ($xId == -1) {
+			return NULL;
+		}
+		$histogram2dNode = new RequestOutputPlotHistogram2DSerieNodeClass(REQUESTOUTPUTPLOTHISTOGRAM2DSERIE_NAME);
+		$histogram2dNode->setXId($xId);
+		$histogram2dNode->setXAxisId(REQUESTOUTPUTPLOTELEMENTXY_XAXISID);
 		$histogram2dNode->setYAxisId($yAxis);
 		if ($index >= 0)
 			$histogram2dNode->setIndex($index);
--
libgit2 0.21.2