]> git.tdb.fi Git - builder.git/blobdiff - source/lib/component.cpp
Reject nonexistent sources
[builder.git] / source / lib / component.cpp
index 4fddcef79de59a9ca0ca6cf05e8a5b71ec565a79..77fbe122dc062dcfe9628bb8446e0d6034b7cd68 100644 (file)
@@ -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);
 }