diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp index 44573db167..f13fb287bc 100644 --- a/src/BufferParams.cpp +++ b/src/BufferParams.cpp @@ -474,8 +474,10 @@ string const BufferParams::readToken(Lexer & lex, string const & token, string const classname = lex.getString(); // if there exists a local layout file, ignore the system one // NOTE: in this case, the textclass (.cls file) is assumed to be available. - pair pp = textclasslist.addTextClass( - classname, filepath.absFilename()); + pair pp; + if (!filepath.empty()) + pp = textclasslist.addTextClass( + classname, filepath.absFilename()); if (pp.first) setBaseClass(pp.second); else {