diff -r 53e577061dc8 -r 3488534b2b31 src/file.cpp --- a/src/file.cpp Fri Aug 02 22:36:51 2013 +0300 +++ b/src/file.cpp Fri Aug 02 23:24:49 2013 +0300 @@ -700,8 +700,11 @@ g_loadingMainFile = tmp; // If we cannot open the file, mark it an error - if (!load) - return new LDErrorObject (line, "Could not open referred file"); + if (!load) { + LDErrorObject* obj = new LDErrorObject (line, "Could not open referred file"); + obj->setFileRef (tokens[14]); + return obj; + } LDSubfileObject* obj = new LDSubfileObject; obj->setColor (tokens[1].toLong());