Commit 317a1681 authored by Houtan Bastani's avatar Houtan Bastani
Browse files

catch situation where user doesn't overrwrite the original reporting object,...

catch situation where user doesn't overrwrite the original reporting object, causing a section to have zero elements
parent 22adc4e8
......@@ -33,6 +33,11 @@ function o = write(o, fid, pg, sec)
assert(fid ~= -1);
fprintf(fid, '%% Section Object\n');
if isempty(o.elements)
warning(['reporting:section.write(): trying to print a section ' ...
'with no elements. Perhaps you forgot to overwrite the report object.']);
return
end
if ~isempty(o.height)
fprintf(fid, '\\setlength\\sectionheight{%s}%%\n', o.height);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment