From 4a12781c1246126e93dbc35522b71f89b919b427 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Thu, 29 Dec 2022 14:54:52 +0200 Subject: [PATCH] Reject nonexistent sources --- source/lib/component.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/lib/component.cpp b/source/lib/component.cpp index 4fddcef..77fbe12 100644 --- a/source/lib/component.cpp +++ b/source/lib/component.cpp @@ -176,5 +176,8 @@ void Component::Loader::require(const string &n) void Component::Loader::source(const string &s) { - obj.sources.push_back((obj.package.get_source_directory()/s).str()); + FS::Path src_path = obj.package.get_source_directory()/s; + if(!FS::exists(src_path)) + throw IO::file_not_found(src_path.str()); + obj.sources.push_back(src_path); } -- 2.43.0