diff --git a/matlab/reporting/@graph/createGraph.m b/matlab/reporting/@graph/createGraph.m
index b985fe971ea7830324c6ecbc2d6f3a85d8a099ab..7d91ec22a7d8849ad9167e985e7d8f2f3e8d3355 100644
--- a/matlab/reporting/@graph/createGraph.m
+++ b/matlab/reporting/@graph/createGraph.m
@@ -33,6 +33,11 @@ if ~isempty(o.figname)
             o.figname);
 end
 
+if ~o.seriesElements.numElements()
+    warning('@graph.crepateGraph: no series to plot, returning');
+    return;
+end
+
 disp('creating plot..........');
 h = figure('visible','off');
 hold on;
diff --git a/matlab/reporting/@graph/write.m b/matlab/reporting/@graph/write.m
index 7eb10c731296667b1bae37dab6399f44557e859c..bce88cf3fce5df96a9838e82203771187efe9c76 100644
--- a/matlab/reporting/@graph/write.m
+++ b/matlab/reporting/@graph/write.m
@@ -33,5 +33,8 @@ assert(fid ~= -1);
 if isempty(o.figname)
     o = createGraph(o);
 end
-fprintf(fid, '\\input{%s}', o.figname);
+
+if ~isempty(o.figname)
+    fprintf(fid, '\\input{%s}', o.figname);
+end
 end
\ No newline at end of file