From ab206b8113c8127f8750e1fb1a541bf20950f225 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Tue, 3 Oct 2017 10:22:30 +0100 Subject: LLL: do not crash if import callback is null --- liblll/CodeFragment.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'liblll') diff --git a/liblll/CodeFragment.cpp b/liblll/CodeFragment.cpp index 49c48027..d4ef3888 100644 --- a/liblll/CodeFragment.cpp +++ b/liblll/CodeFragment.cpp @@ -224,6 +224,8 @@ void CodeFragment::constructOperation(sp::utree const& _t, CompilerState& _s) string fileName = firstAsString(); if (fileName.empty()) error("Empty file name provided"); + if (!m_readFile) + error("Import callback not present"); string contents = m_readFile(fileName); if (contents.empty()) error(std::string("File not found (or empty): ") + fileName); -- cgit