Check whether a class is known before loading it

Fixes bug #10719.

(cherry picked from commit 15a87dd3a8)
This commit is contained in:
Jean-Marc Lasgouttes 2017-07-25 11:51:49 +02:00 committed by Richard Heck
parent 02b248d270
commit d0506a912e

View File

@ -1937,7 +1937,7 @@ void Preamble::parse(Parser & p, string const & forceclass,
if (!forceclass.empty()) if (!forceclass.empty())
h_textclass = forceclass; h_textclass = forceclass;
tc.setName(h_textclass); tc.setName(h_textclass);
if (!tc.load()) { if (!LayoutFileList::get().haveClass(h_textclass) || !tc.load()) {
cerr << "Error: Could not read layout file for textclass \"" << h_textclass << "\"." << endl; cerr << "Error: Could not read layout file for textclass \"" << h_textclass << "\"." << endl;
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }