diff --git a/src/tex2lyx/Preamble.cpp b/src/tex2lyx/Preamble.cpp index 6dcbd5097c..15b41e65cb 100644 --- a/src/tex2lyx/Preamble.cpp +++ b/src/tex2lyx/Preamble.cpp @@ -1937,7 +1937,7 @@ void Preamble::parse(Parser & p, string const & forceclass, if (!forceclass.empty()) h_textclass = forceclass; 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; exit(EXIT_FAILURE); }