diff --git a/liblll/CodeFragment.cpp b/liblll/CodeFragment.cpp index afef63e96..1329ec9b2 100644 --- a/liblll/CodeFragment.cpp +++ b/liblll/CodeFragment.cpp @@ -192,7 +192,13 @@ void CodeFragment::constructOperation(sp::utree const& _t, CompilerState& _s) { if (_t.size() != 2) error(); - m_asm.append(CodeFragment::compile(contentsString(firstAsString()), _s).m_asm); + string fileName = firstAsString(); + if (fileName.empty()) + error("Empty file name provided"); + string contents = contentsString(fileName); + if (contents.empty()) + error(std::string("File not found (or empty): ") + fileName); + m_asm.append(CodeFragment::compile(contents, _s).m_asm); } else if (us == "SET") {